`insert_abbreviation` incorrectly imports python file and incorrectly assumes resources are relative to transformation directory
Saad-Mahamood opened this issue · 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:
- import
grammaire.py
using the full import path:import transformations.insert_abbreviation.grammaire as grammaire
- Remove
sys.path.append("./transformations/insert_abbreviation")
- Use
file = os.path.join(os.path.dirname(os.path.abspath(__file__)), '<file_name>.txt')
to get a handle on the current path relative totransformation.py
script file. This will allow easy access to the two .txt resource files.