# Infinitive marking XML Data is assumed to not include infinitive marking for lemmas. Following is a shortened example entry from a South Sámi / Norwegian data file (v_smanob.xml): åeniedidh avkorte forkorte gjøre kortere förkorta ... etc Note missing å for Norwegian, and missing att for Swedish. Assuming that infinitive information is defined in settings.py, these will automatically be added so that the system recognizes å avkorte and avkorte as acceptable answers in exercizes where Norwegian-language answers are expected. ## Editing settings.py for infinitives The settings.py file needs to include two variables, one to add infinitive information and one to subtract it. Unfortunately at the moment, it cannot be simpler. INFINITIVE_SUBTRACT = { 'nob': ur'^(?På )?(?P.*)$', 'swe': ur'^(?Patt )?(?P.*)$', 'eng': ur'^(?Pto )?(?P.*)$', 'deu': ur'^(?Pzu )?(?P.*)$', } INFINITIVE_ADD = { 'nob': ur'å \g', 'swe': ur'att \g', 'eng': ur'to \g', 'deu': ur'zu \g', } The variables are both dictionaries, and require a key/value pair for the language abbreviation (3-letter ISO name that is used in all data files), and a regular expression. INFINITIVE_SUBTRACT regular expressions are meant to be matching expressions which include a match group for the infinitive (including spaces if necesssary), and a match group for the lemma, which should basically be everything else. The other variable, INFINITIVE_ADD has a regular expression which is equivalent to a Python replace expression, including a group for the lemma \g (which corresponds to (?P.*), and the infinitive string. Although all the languages in the example set here have infinitive particles which come before the lemma, it would be possible to craft strings for infinitive markers which follow. INFINITIVE_SUBTRACT = { ... 'gne': ur'^(?P.*)(?P ot)?$', } INFINITIVE_ADD = { ... 'gne': ur'\g ot', } ## Python regular expression notes The SUBTRACT string needs to include a group for which is optional. This is done by inserting a question mark after the match group: (?Pasdf )?. Also note that if there are any spaces or punctuation included with the infinitive, these must be included as well.