Mikhail Korobov  committed acaff9c

разные мелочи, которые особо ни на что не влияют

  • Participants
  • Parent commits 65a536c
  • Branches default

Comments (0)

Files changed (4)

File docs/

 # All configuration values have a default; values that are commented out
 # serve to show the default.
+from __future__ import unicode_literals
 import sys, os
 master_doc = 'index'
 # General information about the project.
-project = u'Морфологический анализатор pymorphy2'
-copyright = u'2012, Mikhail Korobov'
+project = 'Морфологический анализатор pymorphy2'
+copyright = '2012, Mikhail Korobov'
 # The version info for the project you're documenting, acts as replacement for
 # |version| and |release|, also used in various other places throughout the
 # The name for this set of Sphinx documents.  If None, it defaults to
 # "<project> v<release> documentation".
-html_title = u"Морфологический анализатор pymorphy2"
+html_title = "Морфологический анализатор pymorphy2"
 # A shorter title for the navigation bar.  Default is the same as html_title.
 #html_short_title = u'pymorphy2'
 # Grouping the document tree into LaTeX files. List of tuples
 # (source start file, target name, title, author, documentclass [howto/manual]).
 latex_documents = [
-  ('index', 'pymorphy2.tex', u'pymorphy2 Documentation',
-   u'Mikhail Korobov', 'manual'),
+  ('index', 'pymorphy2.tex', 'pymorphy2 Documentation',
+   'Mikhail Korobov', 'manual'),
 # The name of an image file (relative to this directory) to place at the top of
 # One entry per manual page. List of tuples
 # (source start file, name, description, authors, manual section).
 man_pages = [
-    ('index', 'pymorphy2', u'pymorphy2 Documentation',
-     [u'Mikhail Korobov'], 1)
+    ('index', 'pymorphy2', 'pymorphy2 Documentation',
+     ['Mikhail Korobov'], 1)
 # If true, show URL addresses after external links.
 # (source start file, target name, title, author,
 #  dir menu entry, description, category)
 texinfo_documents = [
-  ('index', 'pymorphy2', u'pymorphy2 Documentation',
-   u'Mikhail Korobov', 'pymorphy2', 'One line description of project.',
+  ('index', 'pymorphy2', 'pymorphy2 Documentation',
+   'Mikhail Korobov', 'pymorphy2', 'One line description of project.',

File pymorphy2/opencorpora_dict/

 def _to_paradigm(lemma):
-    Extract (stem, paradigm) pair from lemma list.
-    Paradigm is a list of suffixes with associated tags and prefixes.
+    Extract (stem, paradigm) pair from lemma (which is a list of
+    (word_form, tag) tuples). Paradigm is a list of suffixes with
+    associated tags and prefixes.
     forms, tags = list(zip(*lemma))
     prefixes = [''] * len(tags)
         stem = longest_common_substring(forms)
         prefixes = [form[:form.index(stem)] for form in forms]
+        # only allow prefixes from LEMMA_PREFIXES
         if any(pref not in LEMMA_PREFIXES for pref in prefixes):
             stem = ""
             prefixes = [''] * len(tags)

File pymorphy2/opencorpora_dict/

 logger = logging.getLogger(__name__)
 LoadedDictionary = collections.namedtuple(
     prediction_suffixes_dawg_len = _dawg_len(compiled_dict.prediction_suffixes_dawg)
     meta = [
-        ['format_version', 1],
+        ['format_version', CURRENT_FORMAT_VERSION],
         ['pymorphy2_version', pymorphy2.__version__],
         ['compiled_at', datetime.datetime.utcnow().isoformat()],
 def _assert_format_is_compatible(meta):
     """ Raise an exception if dictionary format is not compatible """
     format_version = meta.get('format_version', None)
-    if format_version != 1:
+    if format_version != CURRENT_FORMAT_VERSION:
         raise ValueError("This dictionary format ('%s') is not supported." % format_version)

File pymorphy2/

 # Design notes: Tag objects should be immutable.
 class InternalOpencorporaTag(object):
-    __slots__ = ['_grammemes_tuple', '_lemma_grammemes',
-                 '_grammemes_cache', '_str']
+    __slots__ = ['_grammemes_tuple', '_grammemes_cache', '_str']
     FORMAT = 'opencorpora-int'