#NEWLINE# def read_verb_dictionary( verb_path ) : #NEWLINE# #INDENT# ' Reads the verb dictionary from VerbFileName ' #NEWLINE# '\n    ======= VERB DICTIONARY ORGANIZATION =======\n\n    The verb dictionary consists of a set of synsets followed by a series of verb\n    synonyms and patterns.\n\n    VERB SYNONYM BLOCKS AND PATTERNS\n\n    A verb synonym block is a set of verbs which are synonymous (or close enough) with\n    respect to the patterns. The program automatically generates the regular forms of the\n    verb -- endings of \'S\',\'ED\' and \'ING\' -- if it is regular (and, implicitly, English);\n    otherwise the irregular forms can be specified in {...} following the primary verb.\n    Note that if irregular forms are provided in {...}, ALL forms need to be included,\n    even if some of those are the same as the regular form (in other words, no\n    alternative forms are generated when {...} is present). An optional code for the\n    isolated verb can follow in [...].\n\n    The verb block begins with a comment of the form\n\n    --- <GENERAL DESCRIPTION> [<CODE>] ---\n\n    where the "---" signals the beginning of a new block. The code in [...] is the\n    primary code -- typically a two-digit+0 cue-category code -- for the block, and this\n    will be used for all other verbs unless these have their own code. If no code is\n    present, this defaults to the null code "---"  which indicates that the isolated verb\n    does not generate an event. The null code also can be used as a secondary code.\n\n    This is followed by a set of patterns -- these begin with \'-\' -- which generally\n    follow the same syntax as TABARI patterns. The pattern set is terminated with a\n    blank line.\n\n    ====== EXAMPLE =====\n\n    &CURRENCY\n    +DOLLARS\n    +EUROS\n    +AUSTRIAN FLORIN\n    +GOLDEN_GOBLIN_GALLEONS_\n    +PESO\n    +KRONER_\n    +YUM YENNYEN\n    +JAVANESE YEN\n    +SWISS FRANCS\n    +YEN\n\n    &ALTCURR\n    +BITCOIN\n    +PIRATE GOLD_\n    +LEPRECHAUN GOLD_\n\n    &AUXVERB3_\n    +HAVE\n    +HAS\n    +HAD\n\n\n    --- GRANT [070] ---\n    GRANT\n    GIVE {GAVE GIVEN GIVING }  # jw  11/14/91\n    CONTRIBUTE # tony  3/12/91\n    - * &CURRENCY [903] # -PAS 12.01.12\n    - * &ALTCURR [904] # -PAS 14.05.08\n    - * RUPEES  [071]\n\n\n    --- EXPLAIN_VERBAL [010] ---\n    EXPLAIN\n    COMMENT\n    ASSERT\n    SAY  {SAID SAYING }\n    CLARIFY {CLARIFIES CLARIFIED CLARIFYING} [040]\n    CLEAR_UP\n    - * RESTORATION RELATIONS [050:050]  # ANNOUNCE <ab 02 Dec 2005>\n    - * COMMIT &MILITARY TO + [0332]  # SAY <sls 13 Mar 2008>\n    - * ATTACK ON + AS &CRIME [018]  # DESCRIBE <ab 31 Dec 2005>\n    - * &CURRENCY DEBT_RELIEF [0331]  # ANNOUNCE <ab 02 Dec 2005>  , ANNOUNCE\n    - * WELCOMED OFFER FROM + [050]  # ANNOUNCE <ab 02 Dec 2005>\n    - * + THAT $ WILL PULLOUT [0356]  # INFORM <sms 30 Nov 2007>\n    - * POSSIBILITY OF &FIGHT [138]  # MENTION <OY 11 Mar 2006>\n    - * AGREED JOIN COALITION [031]  # ANNOUNCE <OY 15 Mar 2006>\n    - * TRACES RESPONSIBILITY [112]  # REPORT\n    - CONFIRMED * OF BOMBINGS [010]  # REPORT\n    - * INITIATIVE END &FIGHT [036]  # ANNOUNCE <ab 02 Dec 2005>\n\n    &TESTSYN3\n        +TO THE END\n    +TO THE DEATH\n    +UNTIL HELL FREEZES OVER\n\n    &TESTSYN4\n    +TO THE END OF THE EARTH\n    +TO THE DEATH\n\n    --- VOW  [170] ---\n    VOW ;tony  3/9/91\n    - * RESIST &TESTSYN3 [113] ; pas 4/20/03\n    - * RESIST &TESTSYN4  [115] ; pas 4/20/03\n    - * RESISTANCE TO THE INVADING  [114] ; pas 4/20/03\n    - * RESIST  [112] ;tony  4/29/91\n    - * WAR  [173] ;tony  4/22/91\n\n\n    STORAGE STRUCTURE\n    \n    \n    The verbs are stored withing the PETRglobals.VerbDict in two different subdictionaries.\n    The first, "verbs", contains the pattern of the base verb. For most verbs, this is just \n    the word itself, but some verbs like "cordon off" and "wire tap" are multi-word verbs that\n    function as single words. These words are stored as a search tree, with the base root as\n    the word that will be marked as a verb (e.g. cordon and tap). Following these will be a tree \n    structure of all the words in the compound verb that follow the verb, with a # on the end to\n    indicate the end of the search. After the #, all the words before the marked verb are in a similar \n    tree structure in reverse order. A dictionary containing the list [arrest, wire tap, cordon off] \n    would look like:\n    \n    \n                                     \'CORDON\' --- \' OFF\' --- \'#\' --- \'#\'\n                                    /\n                                   /\n                                  /\n    PETRglobals.VerbDict --- \'verbs\'------ \'ARREST\' ---  \'#\' --- \'#\'\n                         \\                                   |                                   |                                    |          \'TAP --- \'#\' --- \'WIRE\' --- \'#\'\n                          |\n                          |\n                      \'patterns\'\n                                     \n                                     \n    After the final \'#\' there is a dictionary with two entries: meaning and code. The meaning\n    is used to find the entry in the patterns dictionary, and the code stores the specific code \n    for that verb if it differs from the code of the meaning. The patterns dictionary stores all\n    the pattern information contained in the files after the synonyms, in a similar \n    verb-after-#-before-#-info dictionary.\n    \n    \n    \n    PROGRAMMING NOTES\n\n    Notes\n    1.  TABARI allowed recursive synsets -- that is, synsetS embedded in patterns and other\n        synsets. It should be possible to do this fairly easily, at least with basic\n        synsets as elements (not as patterns) but a simple call in syn_match(isupperseq)\n        was not sufficient, so this needs more work.\n\n    2.  For TABARI legacy purposes, the construction "XXXX_ " is converted to "XXXX ",\n        an open match.  However, per the comments below, generally TABARI dictionaries\n        should be converted before being used with PETRARCH.\n\n\n    VERB DICTIONARY DIFFERENCES FROM TABARI\n\n    On the *very* remote chance -- see Note 1 -- that you are trying to modify a TABARI\n    .verbs dictionary to the PETRARCH format, the main thing you will need to eliminate\n    are stemmed words:  PETRARCH only works with complete words. On the positive side,\n    PETRARCH will only look at string as a "verb" if it has been identified as such by\n    the parser -- that is, it is preceded with (VP and a tag that starts with (VB, so\n    the [numerous] patterns required for noun/verb disambiguation are no longer\n    needed. PETRARCH also does not allow disconjunctive sets in patterns: to accommodate\n    legacy dictionaries, patterns containing these are skipped, but in order to work,\n    these should be replaced with synsets. Also see additional remarks at the beginning\n    of the file.\n\n    The other big difference between PETRARCH and TABARI is verb-noun disambiguation:\n    the pattern-based approach of TABARI needed a lot of information to insure that a\n    word that *might* be a verb was, in fact, a verb (or was a noun that occurred in a\n    context where it indicated an event anyway: TABARI\'s [in]famous tendency to code the\n    right thing for the wrong reason). PETRARCH, in contrast, only looks as a verb when\n    the parsing has identified it as, in fact, a verb. This dramatically reduces false\n    positives and eliminates the need for any pattern which was required simply for\n    disambiguation, but it also means that PETRARCH is a lot more discriminating about\n    what actually constitutes an event. The big difference here is that verb-only\n    codes are the norm in PETRARCH dictionaries but the exception in TABARI dictionaries.\n\n    The active PETRARCH verbs dictionary has been extensively reorganized into both\n    verb and noun synonym sets, and you are probably better off adding vocabulary to\n    this [see Note 1] than converting a dictionary, but it can be done. An unconverted\n    TABARI dictionary, on the other hand, will generally not work particularly well with\n    PETRARCH.\n\n    Note 1.\n\n    Yeah, right. Every project we\'ve encountered -- including those lavishly funded by\n    multiple millions of taxpayers dollars and those allegedly producing multiple millions\n    of events -- has regarded the NSF-funded CAMEO verbs dictionaries as a sacred artifact\n    of the [infamous] Data Fairy, lowered from Asgaard along the lines of this\n\n    http://www.wikiart.org/en/jacob-jordaens/allegory-of-the-peace-of-westphalia-1654\n\n    [not exactly sure where the .verbs file is in that painting, but it must be in\n    there somewhere]\n\n    but then subsequently subject said dictionaries to bitter complaints that they aren\'t\n    coding comprehensively.\n\n    Look, dudes and dudettes, these dictionaries have been open source for about as long\n    as the US has been at war in Afghanistan -- which is to say, a really long time -- and\n    if you don\'t like how the coding is being done, add some new open-source vocabulary\n    to the dictionaries instead of merely parasitizing the existing work. Dudes.\n\n    The *real* problem, one suspects, is embodied in the following nugget of wisdom:\n\n    Opportunity is missed by most people because it is dressed in overalls and looks\n    like work.\n    Thomas A. Edison\n\n    Dudes.\n\n    ' #NEWLINE# global theverb , verb #NEWLINE# PETRglobals . VerbDict = { #NEWLINE# #INDENT# 'verbs' : { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } , #NEWLINE# 'phrases' : { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } , #NEWLINE# #UNINDENT# } #NEWLINE# def add_dict_tree( targ , verb , meaning = '' , code = '---' , upper = [ ] , synset = False , dict = 'phrases' , line = '' ) : #NEWLINE# #INDENT# prev = verb #NEWLINE# list = PETRglobals . VerbDict [ dict ] . setdefault ( verb , { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } ) #NEWLINE# while ( targ != [ ] ) : #NEWLINE# #INDENT# if ( targ [ 0 ] in [ ' ' , '' ] ) : #NEWLINE# #INDENT# targ = targ [ 1 : ] #NEWLINE# continue #NEWLINE# #UNINDENT# if ( targ [ 0 ] [ 0 ] == '&' ) : #NEWLINE# #INDENT# list = list . setdefault ( 'synsets' , { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } ) #NEWLINE# #UNINDENT# list = list . setdefault ( targ [ 0 ] , { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } ) #NEWLINE# targ = targ [ 1 : ] #NEWLINE# #UNINDENT# list [ '#' ] = list . setdefault ( '#' , { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } ) #NEWLINE# list = list [ '#' ] #NEWLINE# targ = upper #NEWLINE# while ( targ != [ ] ) : #NEWLINE# #INDENT# if ( targ [ ( - 1 ) ] in [ ' ' , '' ] ) : #NEWLINE# #INDENT# targ = targ [ : ( - 1 ) ] #NEWLINE# continue #NEWLINE# #UNINDENT# if ( targ [ ( - 1 ) ] [ 0 ] == '&' ) : #NEWLINE# #INDENT# list = list . setdefault ( 'synsets' , { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } ) #NEWLINE# #UNINDENT# list = list . setdefault ( targ [ ( - 1 ) ] , { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } ) #NEWLINE# targ = targ [ : ( - 1 ) ] #NEWLINE# #UNINDENT# list [ '#' ] = { #NEWLINE# #INDENT# 'meaning' : meaning , #NEWLINE# 'code' : code , #NEWLINE# 'line' : line , #NEWLINE# #UNINDENT# } #NEWLINE# #UNINDENT# def make_phrase_list( thepat ) : #NEWLINE# #INDENT# ' Converts a pattern phrase into a list of alternating words and connectors ' #NEWLINE# if ( len ( thepat ) == 0 ) : #NEWLINE# #INDENT# return [ ] #NEWLINE# #UNINDENT# phlist = [ ] #NEWLINE# start = 0 #NEWLINE# maxlen = ( len ( thepat ) + 1 ) #NEWLINE# while ( start < len ( thepat ) ) : #NEWLINE# #INDENT# spfind = thepat . find ( ' ' , start ) #NEWLINE# if ( spfind == ( - 1 ) ) : #NEWLINE# #INDENT# spfind = maxlen #NEWLINE# #UNINDENT# unfind = thepat . find ( '_' , start ) #NEWLINE# if ( unfind == ( - 1 ) ) : #NEWLINE# #INDENT# unfind = maxlen #NEWLINE# #UNINDENT# if ( unfind < spfind ) : #NEWLINE# #INDENT# phlist . append ( thepat [ start : unfind ] ) #NEWLINE# start = ( unfind + 1 ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# phlist . append ( thepat [ start : spfind ] ) #NEWLINE# phlist . append ( ' ' ) #NEWLINE# start = ( spfind + 1 ) #NEWLINE# #UNINDENT# #UNINDENT# ka = 0 #NEWLINE# while ( ka < len ( phlist ) ) : #NEWLINE# #INDENT# if ( len ( phlist [ ka ] ) > 0 ) : #NEWLINE# #INDENT# if ( ( phlist [ ka ] [ 0 ] == '&' ) and ( phlist [ ka ] not in PETRglobals . VerbDict ) ) : #NEWLINE# #INDENT# print ( 'WTF' , phlist [ ka ] ) #NEWLINE# print ( sorted ( PETRglobals . VerbDict . keys ( ) ) ) #NEWLINE# exit ( ) #NEWLINE# logger . warning ( ( ( 'Synset ' + phlist [ ka ] ) + ' has not been defined; pattern skipped' ) ) #NEWLINE# raise ValueError #NEWLINE# #UNINDENT# #UNINDENT# ka += 2 #NEWLINE# #UNINDENT# return phlist #NEWLINE# #UNINDENT# def get_verb_forms( loccode , line ) : #NEWLINE# #INDENT# '  Read the irregular forms of a verb. ' #NEWLINE# global verb , theverb #NEWLINE# forms = verb [ ( verb . find ( '{' ) + 1 ) : verb . find ( '}' ) ] . split ( ) #NEWLINE# for wrd in forms : #NEWLINE# #INDENT# vscr = wrd #NEWLINE# add_dict_tree ( [ ] , vscr , theverb , loccode , dict = 'verbs' , line = line ) #NEWLINE# #UNINDENT# #UNINDENT# def store_multi_word_verb( loccode , line ) : #NEWLINE# #INDENT# '  Store a multi-word verb and optional irregular forms. ' #NEWLINE# global verb , theverb #NEWLINE# if ( '{' in verb ) : #NEWLINE# #INDENT# forms = verb [ ( verb . find ( '{' ) + 1 ) : verb . find ( '}' ) ] . split ( ) #NEWLINE# forms . append ( verb [ : verb . find ( '{' ) ] . strip ( ) ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# forms = [ verb ] #NEWLINE# plind = ( verb . index ( '+' ) + 1 ) #NEWLINE# if ( verb . find ( '_' , plind ) > 0 ) : #NEWLINE# #INDENT# vroot = verb [ plind : verb . find ( '_' , plind ) ] #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# vroot = verb [ plind : ] #NEWLINE# #UNINDENT# forms . append ( verb . replace ( vroot , ( vroot + 'S' ) ) ) #NEWLINE# if ( vroot [ ( - 1 ) ] == 'E' ) : #NEWLINE# #INDENT# forms . append ( verb . replace ( vroot , ( vroot + 'D' ) ) ) #NEWLINE# forms . append ( verb . replace ( vroot , ( vroot [ : ( - 1 ) ] + 'ING' ) ) ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# forms . append ( verb . replace ( vroot , ( vroot + 'ED' ) ) ) #NEWLINE# forms . append ( verb . replace ( vroot , ( vroot + 'ING' ) ) ) #NEWLINE# #UNINDENT# #UNINDENT# for phrase in forms : #NEWLINE# #INDENT# if ( '+' in phrase ) : #NEWLINE# #INDENT# words = phrase . split ( '_' ) #NEWLINE# multilist = [ ] #NEWLINE# upper = [ ] #NEWLINE# phrase #NEWLINE# if words [ 0 ] . startswith ( '+' ) : #NEWLINE# #INDENT# multilist = [ True ] #NEWLINE# for ka in range ( 1 , len ( words ) ) : #NEWLINE# #INDENT# multilist . append ( words [ ka ] ) #NEWLINE# #UNINDENT# targverb = words [ 0 ] [ 1 : ] #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# upper = [ False ] #NEWLINE# for ka in range ( 2 , ( len ( words ) + 1 ) ) : #NEWLINE# #INDENT# upper . append ( words [ ( len ( words ) - ka ) ] ) #NEWLINE# #UNINDENT# targverb = words [ ( len ( words ) - 1 ) ] [ 1 : ] #NEWLINE# #UNINDENT# add_dict_tree ( multilist [ 1 : ] , targverb , theverb , loccode , upper = upper [ 1 : ] , dict = 'verbs' , line = line ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# logger . warning ( ( ( ( ( 'Error in read_verb_dictionary()/store_multi_word_verb(): ' + phrase ) + ' in ' ) + verb ) + ' is part of a multi-word verb and should contain a +; this was skipped' ) ) #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# def make_verb_forms( loccode , line ) : #NEWLINE# #INDENT# ' Create the regular forms of a verb. ' #NEWLINE# global verb , theverb #NEWLINE# vroot = verb #NEWLINE# vscr = ( ( vroot + 'S' ) if ( vroot [ ( - 1 ) ] not in [ 'S' , 'X' , 'Z' ] ) else ( vroot + 'ES' ) ) #NEWLINE# add_dict_tree ( [ ] , vscr , theverb , loccode , dict = 'verbs' , line = line ) #NEWLINE# if ( vroot [ ( - 1 ) ] == 'E' ) : #NEWLINE# #INDENT# vscr = ( vroot + 'D' ) #NEWLINE# add_dict_tree ( [ ] , vscr , theverb , loccode , dict = 'verbs' , line = line ) #NEWLINE# vscr = ( vroot [ : ( - 1 ) ] + 'ING' ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# vscr = ( vroot + 'ED' ) #NEWLINE# add_dict_tree ( [ ] , vscr , theverb , loccode , dict = 'verbs' , line = line ) #NEWLINE# vscr = ( vroot + 'ING' ) #NEWLINE# #UNINDENT# add_dict_tree ( [ ] , vscr , theverb , loccode , dict = 'verbs' , line = line ) #NEWLINE# #UNINDENT# def make_plural( st ) : #NEWLINE# #INDENT# ' Create the plural of a synonym noun st ' #NEWLINE# if ( 'Y' == st [ ( - 1 ) ] ) : #NEWLINE# #INDENT# return ( st [ : ( - 1 ) ] + 'IES' ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( 'S' == st [ ( - 1 ) ] ) : #NEWLINE# #INDENT# return ( st [ : ( - 1 ) ] + 'ES' ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# return ( st + 'S' ) #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# logger = logging . getLogger ( 'petr_log' ) #NEWLINE# logger . info ( ( 'Reading ' + PETRglobals . VerbFileName ) ) #NEWLINE# open_FIN ( verb_path , 'verb' ) #NEWLINE# theverb = '' #NEWLINE# newblock = False #NEWLINE# ka = 0 #NEWLINE# line = read_FIN_line ( ) #NEWLINE# while ( len ( line ) > 0 ) : #NEWLINE# #INDENT# if ( '[' in line ) : #NEWLINE# #INDENT# part = line . partition ( '[' ) #NEWLINE# verb = part [ 0 ] . strip ( ) #NEWLINE# code = part [ 2 ] [ : part [ 2 ] . find ( ']' ) ] #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# verb = line . strip ( ) #NEWLINE# code = '' #NEWLINE# #UNINDENT# if verb . startswith ( '---' ) : #NEWLINE# #INDENT# if ( len ( code ) > 0 ) : #NEWLINE# #INDENT# primarycode = code #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# primarycode = '---' #NEWLINE# #UNINDENT# newblock = True #NEWLINE# line = read_FIN_line ( ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( verb [ 0 ] == '-' ) : #NEWLINE# #INDENT# if ( '{' in verb ) : #NEWLINE# #INDENT# line = read_FIN_line ( ) #NEWLINE# continue #NEWLINE# #UNINDENT# verb = verb . replace ( '_ ' , ' ' ) #NEWLINE# if ( verb [ ( - 1 ) ] == '_' ) : #NEWLINE# #INDENT# verb = verb [ : ( - 1 ) ] #NEWLINE# #UNINDENT# targ = verb [ 1 : ] . partition ( '*' ) #NEWLINE# try : #NEWLINE# #INDENT# highpat = make_phrase_list ( targ [ 0 ] . lstrip ( ) ) #NEWLINE# lowphrase = targ [ 2 ] . rstrip ( ) #NEWLINE# if ( len ( lowphrase ) == 0 ) : #NEWLINE# #INDENT# lowpat = [ ] #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# lowpat = [ targ [ 2 ] [ 0 ] ] #NEWLINE# loclist = make_phrase_list ( lowphrase [ 1 : ] ) #NEWLINE# lowpat . extend ( loclist [ : ( - 1 ) ] ) #NEWLINE# #UNINDENT# add_dict_tree ( lowpat , theverb , '' , code , highpat , line = line ) #NEWLINE# #UNINDENT# except ValueError : #NEWLINE# #INDENT# pass #NEWLINE# #UNINDENT# line = read_FIN_line ( ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( verb [ 0 ] == '&' ) : #NEWLINE# #INDENT# if ( verb [ ( - 1 ) ] == '_' ) : #NEWLINE# #INDENT# noplural = True #NEWLINE# verb = verb [ : ( - 1 ) ] #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# noplural = False #NEWLINE# #UNINDENT# PETRglobals . VerbDict [ verb ] = { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } #NEWLINE# line = read_FIN_line ( ) #NEWLINE# while ( line [ 0 ] == '+' ) : #NEWLINE# #INDENT# wordstr = line [ 1 : ] . strip ( ) #NEWLINE# if ( noplural or ( wordstr [ ( - 1 ) ] == '_' ) ) : #NEWLINE# #INDENT# wordstr = wordstr . strip ( ) . replace ( '_' , ' ' ) #NEWLINE# add_dict_tree ( wordstr . split ( ) , verb , synset = True , dict = 'verbs' , line = line ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# wordstr = wordstr . replace ( '_' , ' ' ) #NEWLINE# add_dict_tree ( wordstr . split ( ) , verb , synset = True , dict = 'verbs' , line = line ) #NEWLINE# add_dict_tree ( make_plural ( wordstr ) . split ( ) , verb , synset = True , dict = 'verbs' , line = line ) #NEWLINE# #UNINDENT# line = read_FIN_line ( ) #NEWLINE# #UNINDENT# #UNINDENT# else : #NEWLINE# #INDENT# if ( len ( code ) > 0 ) : #NEWLINE# #INDENT# curcode = code #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# curcode = primarycode #NEWLINE# #UNINDENT# if newblock : #NEWLINE# #INDENT# if ( '{' in verb ) : #NEWLINE# #INDENT# theverb = verb [ : verb . find ( '{' ) ] . strip ( ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# theverb = verb #NEWLINE# #UNINDENT# add_dict_tree ( [ ] , theverb , code = curcode , line = line ) #NEWLINE# newblock = False #NEWLINE# #UNINDENT# if ( '_' in verb ) : #NEWLINE# #INDENT# store_multi_word_verb ( curcode , line ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# add_dict_tree ( [ ] , verb . split ( ) [ 0 ] , theverb , curcode , dict = 'verbs' , line = line ) #NEWLINE# if ( '{' in verb ) : #NEWLINE# #INDENT# get_verb_forms ( curcode , line ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# make_verb_forms ( curcode , line ) #NEWLINE# #UNINDENT# #UNINDENT# ka += 1 #NEWLINE# line = read_FIN_line ( ) #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# #UNINDENT# close_FIN ( )