contmpgensql
index
/home/eberdeed/machinetrans-1.13/machinetrans/parser/contmpgensql.py

ContmpGenSQL:  A class to generate English sentences
with contemplative verbs (i.e. verbs that are not
verbs of motion).
Edward C. Eberle <eberdeed@eberdeed.net>
July 4, 2016 San Diego California

 
Modules
       
os
sys

 
Classes
       
machinetrans.parser.wordgensql.WordGenSQL(builtins.object)
ContmpGenSQL

 
class ContmpGenSQL(machinetrans.parser.wordgensql.WordGenSQL)
    A class to generate English sentences
with contemplative verbs (i.e. verbs that are not
verbs of motion).  This is a subclass of WordGenSQL
which handles database management and data generation.
 
 
Method resolution order:
ContmpGenSQL
machinetrans.parser.wordgensql.WordGenSQL
builtins.object

Methods defined here:
__init__(self)
Initialize the class.
makesentences(self, choice)
Generate sentences.

Methods inherited from machinetrans.parser.wordgensql.WordGenSQL:
data(self)
Return the generated sentence data.
newitem(self, wtype)
Take the tokenized data and choose a random entry.
newvocab(self)
Reinitialize the randomly generated sentence vocabulary.
readdata(self)
Here the data is read.  A token representing the word, and sometimes the entire entry, are
read and then added to a list, which is then added to a dictionary for each class.
wordgen(self, choice)
Choose random data and call makesentence to put 
it in a sentence.  makesentence is defined in a subclass.

Data descriptors inherited from machinetrans.parser.wordgensql.WordGenSQL:
__dict__
dictionary for instance variables (if defined)
__weakref__
list of weak references to the object (if defined)

Data and other attributes inherited from machinetrans.parser.wordgensql.WordGenSQL:
articles = ['a', 'the']
classlist = []
datastr = ''
db = None
genclass = frozenset(['adjectives', 'advsmanner', 'articles', 'comparatives', 'conjunctions', 'contemplatives', ...])
itemvals = {}
namelist = []
sentence = {}
sqlcommand = 'SELECT DISTINCT name FROM {};\n'
sqlcommandadj = "SELECT DISTINCT (name, variety) FROM adjectives ...ariety='comparative') AND wordcase='nominative';\n"
sqlcommandadv = "SELECT DISTINCT name FROM adverbs WHERE variety='manner';\n"
sqlcommandnoun = 'SELECT DISTINCT (name, variety, gender) FROM nouns;\n'
sqlcommandpart = "SELECT DISTINCT (enval, variety) FROM participle...ND gender='masculine' AND wordcase='nominative';\n"
sqlcommandpron = "SELECT DISTINCT (name, gender) FROM pronouns WHERE variety='personal' AND wordcase='nominative';\n"
sqlcommandverb = "SELECT DISTINCT (name, variety, tense) FROM verbs WHERE tense='simple present';\n"
sqlcurrent = ''
subject = True
tmpstr = ''
wordinfo = <machinetrans.data.wordtype.WordType object>