Esempio n. 1
0
    def __init__(self, verbosity=0,
                 linkage_limit=100,
                 min_null_count=0,
                 max_null_count=0,
                 islands_ok=False,
                 short_length=16,
                 all_short_connectors=False,
                 display_morphology=False,
                 spell_guess=False,
                 use_sat=False,
                 max_parse_time=-1,
                 disjunct_cost=2.7):

        self._obj = clg.parse_options_create()
        self.verbosity = verbosity
        self.linkage_limit = linkage_limit
        self.min_null_count = min_null_count
        self.max_null_count = max_null_count
        self.islands_ok = islands_ok
        self.short_length = short_length
        self.all_short_connectors = all_short_connectors
        self.display_morphology = display_morphology
        self.spell_guess = spell_guess
        self.use_sat = use_sat
        self.max_parse_time = max_parse_time
        self.disjunct_cost = disjunct_cost
Esempio n. 2
0
    def __init__(self, verbosity=0,
                 linkage_limit=100,
                 min_null_count=0,
                 max_null_count=0,
                 islands_ok=False,
                 short_length=16,
                 all_short_connectors=False,
                 display_morphology=False,
                 spell_guess=False,
                 use_sat=False,
                 max_parse_time=-1,
                 disjunct_cost=2.7):

        self._obj = clg.parse_options_create()
        self.verbosity = verbosity
        self.linkage_limit = linkage_limit
        self.min_null_count = min_null_count
        self.max_null_count = max_null_count
        self.islands_ok = islands_ok
        self.short_length = short_length
        self.all_short_connectors = all_short_connectors
        self.display_morphology = display_morphology
        self.spell_guess = spell_guess
        self.use_sat = use_sat
        self.max_parse_time = max_parse_time
        self.disjunct_cost = disjunct_cost
Esempio n. 3
0
    def __init__(
        self,
        verbosity=0,
        linkage_limit=100,
        min_null_count=0,
        max_null_count=0,
        islands_ok=False,
        short_length=16,
        all_short_connectors=False,
        display_morphology=True,
        spell_guess=False,
        use_sat=False,
        max_parse_time=-1,
        disjunct_cost=None,
        repeatable_rand=True,
        test='',
        debug='',
        dialect='',
    ):

        self._obj = clg.parse_options_create()
        self.verbosity = verbosity
        self.linkage_limit = linkage_limit
        self.min_null_count = min_null_count
        self.max_null_count = max_null_count
        self.islands_ok = islands_ok
        self.short_length = short_length
        self.all_short_connectors = all_short_connectors
        self.display_morphology = display_morphology
        self.spell_guess = spell_guess
        self.use_sat = use_sat
        self.max_parse_time = max_parse_time
        if disjunct_cost is not None:
            self.disjunct_cost = disjunct_cost
        self.repeatable_rand = repeatable_rand
        self.test = test
        self.debug = debug
        self.dialect = dialect
Esempio n. 4
0
def set_opts():
    """
    Настройка параметров парсера
    """
    clg.parse_options_set_max_null_count(parse_opts,6)
    clg.parse_options_set_display_morphology(parse_opts,0)
    clg.parse_options_set_islands_ok(parse_opts, True)
    clg.parse_options_set_linkage_limit(parse_opts,10)
    clg.parse_options_set_disjunct_cost(parse_opts, 2)

def main():
    with open('333333.txt', 'r') as file:
        for line in file:
            vword.append(line[:-1])
    set_opts()
    app = QtWidgets.QApplication(sys.argv)
    window = App()
    window.show()
    app.exec_()

vword = []
lang_dict = clg.dictionary_create_lang("ru")
parse_opts = clg.parse_options_create()
morph = pymorphy2.MorphAnalyzer()
sc = SparkContext()
sqlContext = SQLContext(sc)

if __name__ == '__main__':
    main()