alex.components.nlg.tectotpl.block.t2a.cs package¶
Submodules¶
alex.components.nlg.tectotpl.block.t2a.cs.addappositionpunct module¶
- class alex.components.nlg.tectotpl.block.t2a.cs.addappositionpunct.AddAppositionPunct(scenario, args)[source]¶
Bases: alex.components.nlg.tectotpl.core.block.Block
Separating Czech appositions, such as in ‘John, my best friend, ...’ with commas.
- Arguments:
- language: the language of the target tree selector: the selector of the target tree
alex.components.nlg.tectotpl.block.t2a.cs.addauxverbcompoundfuture module¶
- class alex.components.nlg.tectotpl.block.t2a.cs.addauxverbcompoundfuture.AddAuxVerbCompoundFuture(scenario, args)[source]¶
Bases: alex.components.nlg.tectotpl.core.block.Block
Add compound future auxiliary ‘bude’.
- Arguments:
- language: the language of the target tree selector: the selector of the target tree
alex.components.nlg.tectotpl.block.t2a.cs.addauxverbcompoundpassive module¶
- class alex.components.nlg.tectotpl.block.t2a.cs.addauxverbcompoundpassive.AddAuxVerbCompoundPassive(scenario, args)[source]¶
Bases: alex.components.nlg.tectotpl.core.block.Block
Add compound passive auxiliary ‘být’.
- Arguments:
- language: the language of the target tree selector: the selector of the target tree
alex.components.nlg.tectotpl.block.t2a.cs.addauxverbcompoundpast module¶
- class alex.components.nlg.tectotpl.block.t2a.cs.addauxverbcompoundpast.AddAuxVerbCompoundPast(scenario, args)[source]¶
Bases: alex.components.nlg.tectotpl.core.block.Block
Add compound past tense auxiliary of the 1st and 2nd person ‘jsem/jsi/jsme/jste’.
- Arguments:
- language: the language of the target tree selector: the selector of the target tree
- AUX_PAST_FORMS = {(u'P', u'2'): u'jste', (u'S', u'1'): u'jsem', (u'S', u'2'): u'jsi', (u'.', u'2'): u'jsi', (u'P', u'1'): u'jsme', (u'.', u'1'): u'jsem'}¶
alex.components.nlg.tectotpl.block.t2a.cs.addauxverbconditional module¶
- class alex.components.nlg.tectotpl.block.t2a.cs.addauxverbconditional.AddAuxVerbConditional(scenario, args)[source]¶
Bases: alex.components.nlg.tectotpl.core.block.Block
Add conditional auxiliary ‘by’/’bych’.
- Arguments:
- language: the language of the target tree selector: the selector of the target tree
alex.components.nlg.tectotpl.block.t2a.cs.addauxverbmodal module¶
- class alex.components.nlg.tectotpl.block.t2a.cs.addauxverbmodal.AddAuxVerbModal(scenario, args)[source]¶
Bases: alex.components.nlg.tectotpl.core.block.Block
Add modal verbs.
- Arguments:
- language: the language of the target tree selector: the selector of the target tree
- DEONTMOD_2_MODAL = {u'vol': u'cht\xedt', u'hrt': u'm\xedt', u'perm': u'moci', u'fac': u'moci', u'deb': u'muset', u'poss': u'moci'}¶
alex.components.nlg.tectotpl.block.t2a.cs.addclausalexpletives module¶
- class alex.components.nlg.tectotpl.block.t2a.cs.addclausalexpletives.AddClausalExpletives(scenario, args)[source]¶
Bases: alex.components.nlg.tectotpl.block.t2a.addauxwords.AddAuxWords
Add clausal expletive pronoun ‘to’ (+preposition) to subordinate clauses with ‘že’, if the parent verb requires it.
- Arguments:
- language: the language of the target tree selector: the selector of the target tree
alex.components.nlg.tectotpl.block.t2a.cs.addclausalpunct module¶
- class alex.components.nlg.tectotpl.block.t2a.cs.addclausalpunct.AddClausalPunct(scenario, args)[source]¶
Bases: alex.components.nlg.tectotpl.core.block.Block
An abstract ancestor for blocks working with clausal punctuation.
- Arguments:
- language: the language of the target tree selector: the selector of the target tree
alex.components.nlg.tectotpl.block.t2a.cs.addcoordpunct module¶
- class alex.components.nlg.tectotpl.block.t2a.cs.addcoordpunct.AddCoordPunct(scenario, args)[source]¶
Bases: alex.components.nlg.tectotpl.core.block.Block
Add comma to coordinated lists of 3 and more elements, as well as before some Czech coordination conjunctions (‘ale’, ‘ani’).
- Arguments:
- language: the language of the target tree selector: the selector of the target tree
alex.components.nlg.tectotpl.block.t2a.cs.addparentheses module¶
- class alex.components.nlg.tectotpl.block.t2a.cs.addparentheses.AddParentheses(scenario, args)[source]¶
Bases: alex.components.nlg.tectotpl.core.block.Block
Add ‘(‘ / ‘)’ nodes to nodes which have the wild/is_parenthesis attribute set.
- Arguments:
- language: the language of the target tree selector: the selector of the target tree
- add_parenthesis_node(anode, lemma, clause_num)[source]¶
Add a parenthesis node as a child of the specified a-node; with the given lemma and clause number set.
- continued_paren_left(anode)[source]¶
Return True if this node is continuing a parenthesis from the left.
alex.components.nlg.tectotpl.block.t2a.cs.addprepositions module¶
- class alex.components.nlg.tectotpl.block.t2a.cs.addprepositions.AddPrepositions(scenario, args)[source]¶
Bases: alex.components.nlg.tectotpl.block.t2a.addauxwords.AddAuxWords
Add prepositional a-nodes according to formemes.
- Arguments:
- language: the language of the target tree selector: the selector of the target tree
alex.components.nlg.tectotpl.block.t2a.cs.addreflexiveparticles module¶
- class alex.components.nlg.tectotpl.block.t2a.cs.addreflexiveparticles.AddReflexiveParticles(scenario, args)[source]¶
Bases: alex.components.nlg.tectotpl.core.block.Block
Add reflexive particles to reflexiva tantum and reflexive passive verbs.
- Arguments:
- language: the language of the target tree selector: the selector of the target tree
alex.components.nlg.tectotpl.block.t2a.cs.addsentfinalpunct module¶
- class alex.components.nlg.tectotpl.block.t2a.cs.addsentfinalpunct.AddSentFinalPunct(scenario, args)[source]¶
Bases: alex.components.nlg.tectotpl.block.t2a.cs.addclausalpunct.AddClausalPunct
Add final sentence punctuation (‘?’, ‘.’).
- Arguments:
- language: the language of the target tree selector: the selector of the target tree
alex.components.nlg.tectotpl.block.t2a.cs.addsubconjs module¶
- class alex.components.nlg.tectotpl.block.t2a.cs.addsubconjs.AddSubconjs(scenario, args)[source]¶
Bases: alex.components.nlg.tectotpl.block.t2a.addauxwords.AddAuxWords
Add subordinate conjunction a-nodes according to formemes.
- Arguments:
- language: the language of the target tree selector: the selector of the target tree
alex.components.nlg.tectotpl.block.t2a.cs.addsubordclausepunct module¶
- class alex.components.nlg.tectotpl.block.t2a.cs.addsubordclausepunct.AddSubordClausePunct(scenario, args)[source]¶
Bases: alex.components.nlg.tectotpl.block.t2a.cs.addclausalpunct.AddClausalPunct
Add commas separating subordinate clauses.
- Arguments:
- language: the language of the target tree selector: the selector of the target tree
- are_in_coord_clauses(aleft, aright)[source]¶
Check if the given nodes are in two coordinated clauses.
- get_clause_parent(anode)[source]¶
Return the parent of the clause the given node belongs to; the result may be the root of the tree.
alex.components.nlg.tectotpl.block.t2a.cs.capitalizesentstart module¶
- class alex.components.nlg.tectotpl.block.t2a.cs.capitalizesentstart.CapitalizeSentStart(scenario, args)[source]¶
Bases: alex.components.nlg.tectotpl.core.block.Block
Capitalize the first word in the sentence (skip punctuation etc.).
- OPEN_PUNCT = u'^[({[\u201a\u201e\xab\u2039|*"\\\']+$'¶
alex.components.nlg.tectotpl.block.t2a.cs.deletesuperfluousauxs module¶
- class alex.components.nlg.tectotpl.block.t2a.cs.deletesuperfluousauxs.DeleteSuperfluousAuxs(scenario, args)[source]¶
Bases: alex.components.nlg.tectotpl.core.block.Block
Delete repeated prepositions and and conjunctions in coordinations.
- BASE_DIST_LIMIT = 8¶
- DIST_LIMIT = {u'mezi': 50, u'pro': 8, u'proto\u017ee': 5, u'v': 5}¶
alex.components.nlg.tectotpl.block.t2a.cs.dropsubjpersprons module¶
- class alex.components.nlg.tectotpl.block.t2a.cs.dropsubjpersprons.DropSubjPersProns(scenario, args)[source]¶
Bases: alex.components.nlg.tectotpl.core.block.Block
Remove the Czech pro-drop subject personal pronouns (or demonstrative “to”) from the a-tree.
- Arguments:
- language: the language of the target tree selector: the selector of the target tree
alex.components.nlg.tectotpl.block.t2a.cs.generatepossessiveadjectives module¶
- class alex.components.nlg.tectotpl.block.t2a.cs.generatepossessiveadjectives.GeneratePossessiveAdjectives(scenario, args)[source]¶
Bases: alex.components.nlg.tectotpl.core.block.Block
According to formemes, this changes the lemma of the surface possessive adjectives from the original (deep) lemma which was identical to the noun from which the adjective is derived, e.g. changes the a-node lemma from ‘Čapek’ to ‘Čapkův’ if the corresponding t-node has the ‘adj:poss’ formeme.
- Arguments:
- language: the language of the target tree selector: the selector of the target tree
alex.components.nlg.tectotpl.block.t2a.cs.generatewordforms module¶
alex.components.nlg.tectotpl.block.t2a.cs.imposeattragr module¶
- class alex.components.nlg.tectotpl.block.t2a.cs.imposeattragr.ImposeAttrAgr(scenario, args)[source]¶
Bases: alex.components.nlg.tectotpl.block.t2a.imposeagreement.ImposeAgreement
Impose case, gender and number agreement of attributes with their governing nouns.
- Arguments:
- language: the language of the target tree selector: the selector of the target tree
alex.components.nlg.tectotpl.block.t2a.cs.imposecomplagr module¶
- class alex.components.nlg.tectotpl.block.t2a.cs.imposecomplagr.ImposeComplAgr(scenario, args)[source]¶
Bases: alex.components.nlg.tectotpl.block.t2a.imposeagreement.ImposeAgreement
Impose agreement of adjectival verb complements with the subject.
- Arguments:
- language: the language of the target tree selector: the selector of the target tree
alex.components.nlg.tectotpl.block.t2a.cs.imposepronzagr module¶
- class alex.components.nlg.tectotpl.block.t2a.cs.imposepronzagr.ImposePronZAgr(scenario, args)[source]¶
Bases: alex.components.nlg.tectotpl.block.t2a.imposeagreement.ImposeAgreement
In phrases such as ‘každý z ...’,’žádná z ...’, impose agreement in gender.
- Arguments:
- language: the language of the target tree selector: the selector of the target tree
- PRONOUNS = u'^(jeden|ka\u017ed\xfd|\u017e\xe1dn\xfd|oba|v\u0161echen|(n\u011b|lec)kter\xfd|(jak|kter)\xfdkoliv?|libovoln\xfd)$'¶
alex.components.nlg.tectotpl.block.t2a.cs.imposerelpronagr module¶
- class alex.components.nlg.tectotpl.block.t2a.cs.imposerelpronagr.ImposeRelPronAgr(scenario, args)[source]¶
Bases: alex.components.nlg.tectotpl.block.t2a.imposeagreement.ImposeAgreement
Impose gender and number agreement of relative pronouns with their antecedent.
- Arguments:
- language: the language of the target tree selector: the selector of the target tree
alex.components.nlg.tectotpl.block.t2a.cs.imposesubjpredagr module¶
- class alex.components.nlg.tectotpl.block.t2a.cs.imposesubjpredagr.ImposeSubjPredAgr(scenario, args)[source]¶
Bases: alex.components.nlg.tectotpl.block.t2a.imposeagreement.ImposeAgreement
Impose gender and number agreement of relative pronouns with their antecedent.
- Arguments:
- language: the language of the target tree selector: the selector of the target tree
alex.components.nlg.tectotpl.block.t2a.cs.initmorphcat module¶
- class alex.components.nlg.tectotpl.block.t2a.cs.initmorphcat.InitMorphcat(scenario, args)[source]¶
Bases: alex.components.nlg.tectotpl.core.block.Block
According to t-layer grammatemes, this initializes the morphcat structure at the a-layer that is the basis for a later POS tag limiting in the word form generation.
- Arguments:
- language: the language of the target tree selector: the selector of the target tree
- DEGREE = {u'comp': u'2', u'pos': u'1', u'acomp': u'2', u'sup': u'3', None: u'.', u'nr': u'.'}¶
- GENDER = {u'anim': u'M', u'fem': u'F', u'inan': u'I', u'inher': u'.', u'neut': u'N', None: u'.', u'nr': u'.'}¶
- NEGATION = {None: u'A', u'neg0': u'A', u'neg1': u'N'}¶
- NUMBER = {None: u'.', u'nr': u'.', u'sg': u'S', u'pl': u'P', u'inher': u'.'}¶
- PERSON = {u'1': u'1', None: u'.', u'3': u'3', u'2': u'2', u'inher': u'.'}¶
- VOICE = {u'pas': u'P', u'deagent': u'A', u'passive': u'P', u'act': u'A', u'active': u'A', None: u'.'}¶
alex.components.nlg.tectotpl.block.t2a.cs.marksubject module¶
- class alex.components.nlg.tectotpl.block.t2a.cs.marksubject.MarkSubject(scenario, args)[source]¶
Bases: alex.components.nlg.tectotpl.core.block.Block
Marks the subject of each clause with the Afun ‘Sb’.
- Arguments:
- language: the language of the target tree selector: the selector of the target tree
alex.components.nlg.tectotpl.block.t2a.cs.markverbalcategories module¶
- class alex.components.nlg.tectotpl.block.t2a.cs.markverbalcategories.MarkVerbalCategories(scenario, args)[source]¶
Bases: alex.components.nlg.tectotpl.core.block.Block
Finishes marking synthetic verbal categories: tense, finiteness, mood.
- Arguments:
- language: the language of the target tree selector: the selector of the target tree
alex.components.nlg.tectotpl.block.t2a.cs.movecliticstowackernagel module¶
- class alex.components.nlg.tectotpl.block.t2a.cs.movecliticstowackernagel.MoveCliticsToWackernagel(scenario, args)[source]¶
Bases: alex.components.nlg.tectotpl.core.block.Block
Move clitics (e.g. ‘se’, ‘to’ etc.) to the second (Wackernagel) position in the clause.
- clitic_order(clitic)[source]¶
Return the position of the given clitic in the natural Czech order of multiple clitics in the same clause.
- find_eo1st_pos(clause_root, clause_1st)[source]¶
Find the last word before the Wackernagel position.
- handle_pronoun_je(anode)[source]¶
If the given node is a personal pronoun with the form ‘je’, move it before its parent’s subtree and return True. Return false otherwise.
- is_coord_taking_1st_pos(clause_root)[source]¶
Return True if the clause root is a coordination member and the coordinating conjunction or shared subjunction is taking up the 1st position. E.g. ‘Běžel, aby se zahřál a dostal se dřív domů.’
alex.components.nlg.tectotpl.block.t2a.cs.projectclausenumber module¶
- class alex.components.nlg.tectotpl.block.t2a.cs.projectclausenumber.ProjectClauseNumber(scenario, args)[source]¶
Bases: alex.components.nlg.tectotpl.core.block.Block
Project clause numbering from t-nodes to a-nodes.
- Arguments:
- language: the language of the target tree selector: the selector of the target tree
alex.components.nlg.tectotpl.block.t2a.cs.reversenumbernoundependency module¶
- class alex.components.nlg.tectotpl.block.t2a.cs.reversenumbernoundependency.ReverseNumberNounDependency(scenario, args)[source]¶
Bases: alex.components.nlg.tectotpl.core.block.Block
This block reverses the dependency of incongruent Czech numerals (5 and higher), hanging their parents under them in the a-tree.
- Arguments:
- language: the language of the target tree selector: the selector of the target tree
alex.components.nlg.tectotpl.block.t2a.cs.vocalizeprepos module¶
- class alex.components.nlg.tectotpl.block.t2a.cs.vocalizeprepos.VocalizePrepos(scenario, args)[source]¶
Bases: alex.components.nlg.tectotpl.core.block.Block
This block replaces the forms of prepositions ‘k’, ‘v’, ‘z’, ‘s’ with their vocalized variants ‘ke’/’ku’, ‘ve’, ‘ze’, ‘se’ according to the following word.