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

Improve display output #36

Merged
merged 4 commits into from
Jul 10, 2023
Merged

Conversation

jcfr
Copy link
Contributor

@jcfr jcfr commented Jul 8, 2023

After:

Additional dictionary: /home/jcfr/Projects/SimpleITKSpellChecking/additional_dictionary.txt
Additional dictionary: tests/dict.txt
Prefixes: ['sitk', 'itk', 'vtk', 'myprefix']
Suffixes: ['.h']

Checking tests/example.h
spell_check_file: tests/example.h, text/x-c++
Line 3:  Mary had a little lamb
Line 4: 
Line 5:  Prefix test words:
Line 6:  sitkBanana
Error: sitkBanana
Trying without 'sitk' prefix: sitkBanana -> Banana
Line 7:  vtkApple
Error: vtkApple
Trying without 'vtk' prefix: vtkApple -> Apple
Line 8:  itkPineapple
Error: itkPineapple
Trying without 'itk' prefix: itkPineapple -> Pineapple
Line 9: 
Line 10:  Camel case test word:
Line 11:  CamelCaseTestWord
[...]

Before:

Prefixes: ['sitk', 'itk', 'vtk']
Suffixes: ['.h']

Checking tests/example.h
spell_check_file: tests/example.h , text/x-c++
Comment:   Mary had a little lamb
<class 'comment_parser.parsers.common.Comment'>
Comment:  
<class 'comment_parser.parsers.common.Comment'>
Comment:   Prefix test words:
<class 'comment_parser.parsers.common.Comment'>
Comment:   sitkBanana
<class 'comment_parser.parsers.common.Comment'>
Error: sitkBanana
Trying without prefix:  sitkBanana Banana
Trying splitting camel case word
Comment:   vtkApple
<class 'comment_parser.parsers.common.Comment'>
Error: vtkApple
Trying without prefix:  vtkApple Apple
Trying splitting camel case word
Comment:   itkPineapple
<class 'comment_parser.parsers.common.Comment'>
Error: itkPineapple
Trying without prefix:  itkPineapple Pineapple
Trying splitting camel case word
Comment:  
<class 'comment_parser.parsers.common.Comment'>
Comment:   Camel case test word:
<class 'comment_parser.parsers.common.Comment'>
Comment:   CamelCaseTestWord
<class 'comment_parser.parsers.common.Comment'>
Error: CamelCaseTestWord

@jcfr jcfr mentioned this pull request Jul 8, 2023
@jcfr
Copy link
Contributor Author

jcfr commented Jul 8, 2023

I will create a pull-request introducing spell_check_comment once the other ones are integrated.

@jcfr jcfr marked this pull request as draft July 8, 2023 21:22
@jcfr
Copy link
Contributor Author

jcfr commented Jul 10, 2023

I will create a pull request introducing spell_check_comment once the other ones are integrated.

jcfr added 4 commits July 10, 2023 10:50
For comparison, here is an excerpt of the before and after output
when running the tests with "python -m unittest discover -s tests"

Before
------

Checking tests/example.h
spell_check_file: tests/example.h, text/x-c++
Comment:  Mary had a little lamb
<class 'comment_parser.parsers.common.Comment'>
Comment:
<class 'comment_parser.parsers.common.Comment'>
Comment:  Prefix test words:
<class 'comment_parser.parsers.common.Comment'>
Comment:  sitkBanana
<class 'comment_parser.parsers.common.Comment'>
Error: sitkBanana
Trying without 'sitk' prefix: sitkBanana -> Banana
Comment:  vtkApple
<class 'comment_parser.parsers.common.Comment'>


After
-----

Checking tests/example.h
spell_check_file: tests/example.h, text/x-c++
Line 3:  Mary had a little lamb
Line 4:
Line 5:  Prefix test words:
Line 6:  sitkBanana
Error: sitkBanana
Trying without 'sitk' prefix: sitkBanana -> Banana
Line 7:  vtkApple
Error: vtkApple
Trying without 'vtk' prefix: vtkApple -> Apple
@jcfr jcfr marked this pull request as ready for review July 10, 2023 14:51
@dave3d dave3d merged commit 48248fd into SimpleITK:main Jul 10, 2023
@jcfr jcfr deleted the improve-display-output branch July 11, 2023 00:22
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.

2 participants