-
Notifications
You must be signed in to change notification settings - Fork 4
Project Structure
Adrian Zhao edited this page May 8, 2021
·
1 revision
The root folder contains 2 folders: app and pyscript
app folder contains the web application (frontend) powered by ReactJS.
pyscript folder contains the python scripts (backend) that contain the main logic for phonogenesis.
pyscript/app contains the backend API (routes.py) and the database models (models.py), powered by Flask and sqlalchemy. Note that the database models are mostly unrelated to the core phonogenesis functionalities. They were designed for supporting extensive web features that requires login (deprecated at the moment).
pyscript/script contains the main logic scripts and the data files.
pyscript/script/data contains the data files:
-
defaultgloss.txtcontains the program default gloss data. The data is split into different sections, each section starts with### <category>. Gloss words on the same line have similar meanings and types. Gloss words on the same line are separated by|. -
defaultipa.csvdefault IPA sound dataset. Each column corresponds to a feature, denoted by the column header. Each row, starting with the first column being the sound symbol, contains all the features that uniquely identify that sound. There should not be two different sounds with exact same features. -
defaultpresetphoneme.txtcontains a set of sounds that are used by the program by default as the full phoneme set. -
defaultphonemerandomization.txtcontains a set of rules for randomly generating a phoneme set (see file for details) -
defaultrules.csvcontains a set of rules denoted by a special syntax system, identified by its name and grouped by its rule family. -
defaulttemplate.txtcontains a set of templates used by the program by default. -
paradigmtransdata.txtcontains all possible column header combinations for each gloss word category in a paradigm question. -
paradigmtranstemplates.txtcontains templates that are used to generated morphemes in a paradigm question.
pyscript/script scripts:
-
data_factory.pyprovides utility function for getting formatted data from data files. -
doubleRule.pylogic for generating question that involves two different rules applied one after the other. -
feature_lib.pycontainsParticleclass (data structure for representing a set of features) and logic for fetching raw data fromdefaultipa.csv. -
generator.pycontainsGeneratorclass that generates a simple question (UR, SR and single rule). -
glossgroup.pycontainsGlossGroupandGlossFamilyclass and logic for fetching gloss data fromdefaultgloss.txt -
main.pytest script. used only for testing purposes -
morphology.pycontains classes (ParadigmandParadigmGenerator) and logic for generating a morphology question. -
phonemes.pyfetches phoneme data and applies phoneme randomization from data files (defaultpresetphoneme.txt,defaultphonemerandomization.txt). -
rules.pycontains classRule(data structure for representing a rule) and logic for fetching rules fromdefaultrules.csv -
sound.pycontains classSound(data structure for representing an IPA sound) -
templates.pycontains classTemplate(data structure for representing a template) and logic for fetching rules fromdefaulttemplate.txt -
word.pycontains classWord(data structure for representing a word - list of sounds)