Beispiel #1
0
 def test_load(self):
     with tempfile.NamedTemporaryFile(delete=False) as voc_f:
         with tempfile.NamedTemporaryFile(delete=False) as dict_f:
             import_texts(morph,
                          source_dir=os.path.join(APP_DIR, 'fixtures', 'texts_src'),
                          tech_vocabulary_path=os.path.join(APP_DIR, 'fixtures', 'vocabulary.json'),
                          voc_storage=voc_f.name,
                          dict_storage=dict_f.name)
Beispiel #2
0
 def test_load(self):
     with tempfile.NamedTemporaryFile(delete=False) as voc_f:
         with tempfile.NamedTemporaryFile(delete=False) as dict_f:
             import_texts(morph,
                          source_dir=os.path.join(APP_DIR, 'fixtures',
                                                  'texts_src'),
                          tech_vocabulary_path=os.path.join(
                              APP_DIR, 'fixtures', 'vocabulary.json'),
                          voc_storage=voc_f.name,
                          dict_storage=dict_f.name)
Beispiel #3
0
# coding: utf-8
import os
import pymorphy

from textgen.conf import APP_DIR, textgen_settings
from textgen.logic import import_texts

morph = pymorphy.get_morph(textgen_settings.PYMORPHY_DICTS_DIRECTORY)

import_texts(
    morph,
    source_dir=os.path.join(APP_DIR, "fixtures", "texts_src"),
    tech_vocabulary_path=os.path.join(APP_DIR, "fixtures", "vocabulary.json"),
    voc_storage="/tmp/voc.json",
    dict_storage="/tmp/dict.json",
    print_undefined_words=True,
)
Beispiel #4
0
# coding: utf-8
import os
import pymorphy

from textgen.conf import APP_DIR, textgen_settings
from textgen.logic import import_texts

morph = pymorphy.get_morph(textgen_settings.PYMORPHY_DICTS_DIRECTORY)

import_texts(morph,
             source_dir=os.path.join(APP_DIR, 'fixtures', 'texts_src'),
             tech_vocabulary_path=os.path.join(APP_DIR, 'fixtures', 'vocabulary.json'),
             voc_storage='/tmp/voc.json',
             dict_storage='/tmp/dict.json',
             print_undefined_words=True)