py/gadict.py
changeset 594 910efcf51ac0
parent 593 32de94c1b039
child 618 6ad7203ac9dc
equal deleted inserted replaced
593:32de94c1b039 594:910efcf51ac0
   114 
   114 
   115     SEPARATOR_RE = regex.compile(u"^__$")
   115     SEPARATOR_RE = regex.compile(u"^__$")
   116     HEADWORD_RE = regex.compile( u"^(\\p{L}.*)$" )
   116     HEADWORD_RE = regex.compile( u"^(\\p{L}.*)$" )
   117     HEADWORD_VAR_RE = regex.compile(u"^ +(s|pl|v[123]|male|female|comp|super|abbr|Am|Br|Au)$")
   117     HEADWORD_VAR_RE = regex.compile(u"^ +(s|pl|v[123]|male|female|comp|super|abbr|Am|Br|Au)$")
   118     HEADWORD_PRON_RE = regex.compile(u"^ +\\[([\p{L}' ]+)\\]$")
   118     HEADWORD_PRON_RE = regex.compile(u"^ +\\[([\p{L}' ]+)\\]$")
   119     TRANSL_POS_RE = regex.compile(u"^n|det|pron|adj|v|adv|prep|conj|num|int|phr|phr\\.v|contr|abbr|prefix$")
   119     TRANSL_POS_RE = regex.compile(u"^(?:n|det|pron|adj|v|adv|prep|conj|num|int|phr|phr\\.v|contr|abbr|prefix)$")
   120     TRANSL_RE = regex.compile(u"^(ru|uk|la|en): ([\\p{L}(].*)$")
   120     TRANSL_RE = regex.compile(u"^(ru|uk|la|en): ([\\p{L}(].*)$")
   121     TRANSL_EX_RE = regex.compile(u"^(ru|uk|la|en)> ([-\\p{L}].*)$")
   121     TRANSL_EX_RE = regex.compile(u"^(ru|uk|la|en)> ([-\\p{L}].*)$")
   122     TRANSL_GLOS_RE = regex.compile(u"^(ru|uk|la|en)= ([-\\p{L}].*)$")
   122     TRANSL_GLOS_RE = regex.compile(u"^(ru|uk|la|en)= ([-\\p{L}].*)$")
   123     TOPIC_RE = regex.compile(u"^topic: (\\p{L}.*)$")
   123     TOPIC_RE = regex.compile(u"^topic: (\\p{L}.*)$")
   124     SYN_RE = regex.compile(u"^syn: (\\p{L}.*)$")
   124     SYN_RE = regex.compile(u"^syn: (\\p{L}.*)$")
   355                 sense.add_glos((m.group(1), m.group(2) + self.parse_translation_continuation()))
   355                 sense.add_glos((m.group(1), m.group(2) + self.parse_translation_continuation()))
   356                 read = False
   356                 read = False
   357                 continue
   357                 continue
   358             raise ParseException("""Uknown syntax...""")
   358             raise ParseException("""Uknown syntax...""")
   359         self.tran = senses
   359         self.tran = senses
       
   360 
       
   361     def __repr__(self):
       
   362         return u"<{:s}; line={:s}>".format(type(self).__name__, repr(self.line))