-
Notifications
You must be signed in to change notification settings - Fork 21
Open
Labels
enhancementNew feature or requestNew feature or request
Description
Hello,
first of all: thanks for this project. I just try it for dictionary I maintained and it fails with :
ValueError: invalid literal for int() with base 10: 'šími/Fs'
Which is great because .aff file has error, but this message does not said for ordinary user...
Is there any function to check correctness of .dic and .aff files?
Or at least please provide better error message with something like this:
@@ -246,10 +246,15 @@ def read_value(source: BaseReader, directive: str, *values, context: Context) ->
]
if directive in ['SFX', 'PFX']:
flag, crossproduct, count, *_ = values
- return [
- make_affix(directive, flag, crossproduct, *line, context=context)
- for line in _read_array(int(count))
- ]
+ try:
+ return [
+ make_affix(directive, flag, crossproduct, *line, context=context)
+ for line in _read_array(int(count))
+ ]
+ except ValueError as error:
+ print(f"Error at: directive, values: {directive}, {values}")
+ print(f"Maybe wrong count of rules?")
+ raise errorMost of the spellcheckers create function for end users but forgot about dictionary creators and maintainers ;-) (Aspell at least tried to report e.g. affix problems when creating dictionary from wordlist...)
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request