Team Ai
Apppublic

RecursionCat/AbhayaWordLookup

sourceHugging Facemitupdated 7mo agoView on Hugging Face
0likes
Rules.md49 linesDownload Raw Back to root
1## General Guidelines2 3- To start server run `main <port number>`4- All requirements are listed in requirements.txt. Install with `pip install -r requirements.txt`5- The general Folder Structure is listed Below6 7```plaintext8├── main.py9├── dependencies.py10├── requirements.txt11│12├── languages/13│   ├── __init__.py14│   ├── english/15│   │   ├── __init__.py16│   │   ├── english.py17│   │   ├── dependencies.py18│   │   └── dictionary.json19│   │20│   ├── bangla/21│   │   ├── __init__.py22│   │   ├── bangla.py23│   │   ├── dependencies.py24│   │   └── dictionary.json25│   │26│   └── hindi/27│       ├── __init__.py28│       ├── hindi.py29│       ├── dependencies.py30│       └── dictionary.json31│32└── utils/33    ├── __init__.py34    └── language_loader.py35```36 37Any folder with an `__init__.py` is a python module and can be accessed inside code using the `.` notation.38 39## Add a Language40 41- To add a language create a new folder inside the `languages/` directory with the name of your desired language. Keep in mind the <b>name of the folder must be in uppercase</b>.42- Create a `.py` file inside the folder. The name of the <b>main py file</b> must be the <b>lowercase</b> version of whatever the folder name is. Since most of this will be sent directly from the frontend, the frontend must send the whole name of the language in all lower case to the route `/getword/<language>/<word>`.43- Inside the pyfile there must be a class name <b>&lt;LanguageName-in-Title-Format&gt;Lookup</b> and that class must inherit the `BaseLanguageClass` from `utils.language_loader`. This ensures that each class must implement the `init`, `parseResults` and `close` methods. This ensures that all outputs and language systems behave the same.44- `parseResults` must always return the required output for a word in the `dict` format.45 46## Change Requirements47All necessary requirement changes, including case and import logic can be done inside of the utils package. It also contains the Vowels and Consonant classes inside `utils.language_phonetics`.48 49