Exemplo n.º 1
0
    def __init__(self, lang = "en",
                       verbosity = 1,
                       linkage_limit = 100,
                       min_null_count = 0,
                       max_null_count = 0,
                       islands_ok = False,
                       short_length = 6,
                       all_short_connectors = False,
                       display_morphology = False,
                       spell_guess = False,
                       max_parse_time = -1,
                       disjunct_cost = 2.7):
        # locale.setlocale(locale.LC_ALL, "en_US.UTF-8")     -- windows uses different country strings

        datadir = os.getenv("LINK_GRAMMAR_DATA", ".\\resources\\lg-floras");
        if datadir:
            # Make sure we use an absolute path, else "Error opening word file..."
            datadir = os.path.abspath(datadir)
            clg.dictionary_set_data_dir(datadir)
        try:
            self.dictionary = Dictionary(lang)
        except FileNotFoundError:
            return None

        self.parse_options = ParseOptions(verbosity = verbosity,
                                          linkage_limit = linkage_limit,
                                          min_null_count = min_null_count,
                                          max_null_count = max_null_count,
                                          islands_ok = islands_ok,
                                          short_length = short_length,
                                          display_morphology = display_morphology,
                                          spell_guess = spell_guess,
                                          max_parse_time = max_parse_time,
                                          disjunct_cost = disjunct_cost)
Exemplo n.º 2
0
def dictionary_set_data_dir(*args) -> "void" :
  return _clinkgrammar.dictionary_set_data_dir(*args)
Exemplo n.º 3
0
def dictionary_set_data_dir(*args):
  return _clinkgrammar.dictionary_set_data_dir(*args)
Exemplo n.º 4
0
def dictionary_set_data_dir(path):
    return _clinkgrammar.dictionary_set_data_dir(path)
Exemplo n.º 5
0
def dictionary_set_data_dir(path: 'char const *') -> "void":
    return _clinkgrammar.dictionary_set_data_dir(path)
Exemplo n.º 6
0
def setUpModule():
    datadir = os.getenv("LINK_GRAMMAR_DATA", "")
    if datadir:
        # Make sure we use an absolute path, else "Error opening word file..."
        datadir = os.path.abspath(datadir)
        clg.dictionary_set_data_dir(datadir)
Exemplo n.º 7
0
def setUpModule():
    datadir = os.getenv("LINK_GRAMMAR_DATA", '..\\resources\\lg-floras\\');
    if datadir:
        # Make sure we use an absolute path, else "Error opening word file..."
        datadir = os.path.abspath(datadir)
        clg.dictionary_set_data_dir(datadir)