Commits

Mikhail Korobov committed 494cf69

better variable names

Comments (0)

Files changed (1)

pymorphy2/opencorpora_dict/compile.py

     paradigms = []
     words = []
 
-    seen_tags = dict()
-    seen_paradigms = dict()
+    tag_ids = dict()
+    paradigms_ids = dict()
 
     logger.info("inlining lexeme derivational rules...")
     lexemes = _join_lexemes(parsed_dict.lexemes, parsed_dict.links)
 
         # build gramtab
         for suff, tag, pref in paradigm:
-            if tag not in seen_tags:
-                seen_tags[tag] = len(gramtab)
+            if tag not in tag_ids:
+                tag_ids[tag] = len(gramtab)
                 gramtab.append(tag)
 
         # build paradigm index
-        if paradigm not in seen_paradigms:
-            seen_paradigms[paradigm] = len(paradigms)
+        if paradigm not in paradigms_ids:
+            paradigms_ids[paradigm] = len(paradigms)
             paradigms.append(
-                tuple([(suff, seen_tags[tag], pref) for suff, tag, pref in paradigm])
+                tuple([(suff, tag_ids[tag], pref) for suff, tag, pref in paradigm])
             )
 
-        para_id = seen_paradigms[paradigm]
+        para_id = paradigms_ids[paradigm]
         paradigm_popularity[para_id] += 1
 
         for idx, (suff, tag, pref) in enumerate(paradigm):
 
     forms = [get_form(para) for para in paradigms]
     suffixes = sorted(set(list(itertools.chain(*forms))))
-    suffixes_dict = dict(
+    suffix_ids = dict(
         (suff, index)
         for index, suff in enumerate(suffixes)
     )
         para = []
         for suff, tag, pref in paradigm:
             para.append(
-                (suffixes_dict[suff], tag, PARADIGM_PREFIXES.index(pref))
+                (suffix_ids[suff], tag, PARADIGM_PREFIXES.index(pref))
             )
         return para