Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(Issue 494): Enhance warning functionality #559

Merged
merged 3 commits into from
Oct 18, 2024

Conversation

rminsil
Copy link
Collaborator

@rminsil rminsil commented Oct 11, 2024

This PR adds warning functionality:

  • the script outputs warnings
  • more kinds of warnings are detected

I also did some refactoring to make adding warning code cleaner, so it's a big PR (sorry Damien!)

There's two kinds of warnings right now:

  • consecutive punctuation characters (ignoring whitespace)
  • (false negative) punctuation found in the sentences that doesn't have rules defined for it

Here is an example of some warning output:

7 warnings found
====================================================================================================
line: 1
            0         1         2         3         4         5
            012345678901234567890123456789012345678901234567890123456789
           'Hi there - you! (my -    friend )  How's   it  going ?'
                          ^^^
                          (14,17)
>>> WARNING_CODE: 0
>>> DESCRIPTION: Multiple consecutive punctuation characters (ignoring whitespace) - currently this is not normalized
====================================================================================================
line: 2
            0         1         2         3
            0123456789012345678901234567890123456789
           'Hello, . there ! How , are  things !?'
                 ^^^
                 (5,8)
>>> WARNING_CODE: 0
>>> DESCRIPTION: Multiple consecutive punctuation characters (ignoring whitespace) - currently this is not normalized
====================================================================================================
line: 2
            0         1         2         3
            0123456789012345678901234567890123456789
           'Hello, . there ! How , are  things !?'
                                               ^^
                                               (35,37)
>>> WARNING_CODE: 0
>>> DESCRIPTION: Multiple consecutive punctuation characters (ignoring whitespace) - currently this is not normalized
====================================================================================================
line: 3
            0         1         2         3         4
            01234567890123456789012345678901234567890123456789
           'An arabic 3 ٣. Some angle brackets « and ».'
                                               ^
                                               (35,36)
>>> WARNING_CODE: 1
>>> DESCRIPTION: Character '«' (U+00AB) is not a letter or digit or whitespace and is not listed as punctuation. Potential false negative.
====================================================================================================
line: 3
            0         1         2         3         4
            01234567890123456789012345678901234567890123456789
           'An arabic 3 ٣. Some angle brackets « and ».'
                                                     ^
                                                     (41,42)
>>> WARNING_CODE: 1
>>> DESCRIPTION: Character '»' (U+00BB) is not a letter or digit or whitespace and is not listed as punctuation. Potential false negative.
====================================================================================================
line: 4
            0         1         2         3
            0123456789012345678901234567890123456789
           'Hello,  . there! How are things !?'
                 ^^^^
                 (5,9)
>>> WARNING_CODE: 0
>>> DESCRIPTION: Multiple consecutive punctuation characters (ignoring whitespace) - currently this is not normalized
====================================================================================================
line: 4
            0         1         2         3
            0123456789012345678901234567890123456789
           'Hello,  . there! How are things !?'
                                            ^^
                                            (32,34)
>>> WARNING_CODE: 0
>>> DESCRIPTION: Multiple consecutive punctuation characters (ignoring whitespace) - currently this is not normalized

This change is Reviewable

@rminsil rminsil requested a review from ddaspit October 11, 2024 11:37
@rminsil rminsil linked an issue Oct 11, 2024 that may be closed by this pull request
Base automatically changed from issue-494-add-tests-for-normalization-fix-little-bugs to master October 18, 2024 05:26
@rminsil rminsil force-pushed the issue-494-fill-out-warning-reporting branch from 7242213 to 4aab55c Compare October 18, 2024 05:27
@rminsil rminsil merged commit 2ff6f9e into master Oct 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add data transformation and cleaning to XRI etl script
1 participant