Vasta MorfaC
File dependencies
- Word lexicon file (n_smanob.xml)
- Paradigm file (paradigms.txt)
- tags file (tags.txt)
paradigms.txt
Both the paradigms file and tags file are important for Morfa-S and Morfa-C to function. paradigms.txt is simply a list of all of the tags for the wordforms that will be generated. These are separated by newlines.
V+Ind+Prs+Sg1 V+Ind+Prs+Sg2 V+Ind+Prs+Sg3 etc...
It may be useful to split up the paradigm files by part of speech, in order to have more detailed control over the paradigms in the event that certain kinds of verbs need to be separated from eachother, and so on...
NOTE: If you split up paradigm files, it is important to also have one file containing all of the possible tag strings, because tag and paradigm files are also installed separately for Morfa-C.
tags.txt
This file defines tag classes and groups. It is required for both Morfa-C and Morfa-S. The file is a collection of lists of individual tags (Prop, Pers, Logo; PxSg1, PxSg2, etc.) split up by a name.
#Subclass Prop Pers Logo #Possessive PxSg1 PxSg2 PxSg3
This file may also be used to generate custom tag sets for Morfa-C, so that when creating questions, one could refer to only 1st and 2nd persons:
#1st2ndPerson Sg1 Sg2 Du1 Du2 Pl1 Pl2
In Morfa-C these tags are used in both question files and grammar_defaults.xml any time a tag is specified:
<grammar tag="Pron+Pers+1st2ndPerson+Nom" />
grammar_defaults.xml
Grammar_defaults is a collection of shortcuts for oft repeated material, which may be used in Morfa-C questions. They may be overridden by specifying in more detail in the individual question files. Grammar default definitions and syntax follow those in question files, and they must be included in the install of every question file. They also rely on paradigms and tags files, because they may refer to tagsets.
Installation command
- Tag and Paradigm installation (must be completed first)
python install.py -r paradigms.txt -t tags.txt
- Question file installation
python install.py -g grammar_defaults.xml -q question_file.xml
To be written:
- settings.py
- DEFAULT_DIALECT
- L1
- DEFAULT_DIALECT
- smadrill/urls.py
- Urls pertaining to Morfa-C/Morfa-R are those named for sma. raajese"sentence"
- smadrill/views.py
- cmgame
- Gameview
- cmgame
- smadrill/game.py
- Game
- smadrill/mgame.py
- QAGame (a subclass of game.Game)
- smadrill/forms.py
- MorfaSettings
- ContextMorfaQuestion
- MorfaSettings
- templates and their inheritance structure
- views call the farthest down template in the inheritance hierarchy, and
- views call the farthest down template in the inheritance hierarchy, and
templates/smaoahpa_main.html templates/smaoahpa.html smadrill/templates/game.html smadrill/templates/mgame.html smadrill/templates/mgame_a.html smadrill/templates/mgame_l.html smadrill/templates/mgame_n.html smadrill/templates/mgame_p.html smadrill/templates/mgame_v.html
Installing questions
Intro
Morfa-C and Vasta also use tag, tag-set and paradigm information, which is
Sometimes, additional words are required which are not in the other lexicon files.
The command
The command for updating the questions is:
python install.py -g ../sme/xml/grammar_defaults.xml -q ../sme/xml/questions_nouns.xml
Everything inside the question xml-file may be changed and the database
python install.py --qid <question_id> .. or by using the question text python install.py --qid "Maid SUBJ MAINV"
Of course the latter command will delete all the questions with that
Available tags and paradigms are stored to the database beforehand and
python install.py -r ../sme/src/paradigms.txt -t ../sme/src/tags.txt -b
Adding question types
To add a new question type to Morfa-C I need to edit the following files, often doing things that are repeated across multiple places
- smadrill/game.py
- smadrill/views.py
- Add a key-value pair to self.gamenames
- smadrill/forms.py
- ContextMorfaQuestion, CASE_CONTEXT_CHOICES, PRON_CONTEXT_CHOICES, etc.
- smadrill/mgame.py
Dependencies
- questions file
- grammar defaults file
- tags file
- paradigm file
Installation
1. Install grammar tags and paradigm information
python install.py -r data_sma/meta/paradigms.txt -t data_sma/meta/tags.txt -b
2. Install fillings (optional)
python install.py -f fillingsfile.xml --paradigmfile paradigms.txt --tagfile tags.txt
3. Install question file
python install.py -g ../sme/xml/grammar_defaults.xml -q ../sme/xml/questions_nouns.xml
Everything inside the question xml-file may be changed and the database
python install.py --qid <question_id>
.. or by using the question text
python install.py --qid "Maid SUBJ MAINV"
Of course the latter command will delete all the questions with that