`correct_common_misspellings` throws FileNotFoundError and incorrectly assumes resources are relative to transformation directory
Saad-Mahamood opened this issue · 0 comments
Saad-Mahamood commented
These issues appear when trying to use this transformation outside of the root NL-Augumenter directory. For example in another sub-directory off the root directory. The fixes needed are the following:
- Remove:
spell_corrections = os.path.join(
"transformations", "correct_common_misspellings", "spell_corrections.json"
)
- Use
file = os.path.join(os.path.dirname(os.path.abspath(__file__)), 'spell_corrections.json')
to get a handle on the current path relative to transformation.py script file.