Beispiel #1
0
 def parse_sent(self, txt):
     sent = clg.sentence_create(txt,self.dictionary._dict)
     n = clg.sentence_parse(sent, self.parse_options._po)
     if n > 0:
         linkages = [Linkage.create_from_sentence(i,sent, self.parse_options._po) for i in range(n)]
     else:
         linkages = []
     clg.sentence_delete(sent)
     return linkages
Beispiel #2
0
 def parse_sent(self, txt):
     sent = clg.sentence_create(txt, self.dictionary._dict)
     n = clg.sentence_parse(sent, self.parse_options._po)
     if n > 0:
         linkages = [
             Linkage.create_from_sentence(i, sent, self.parse_options._po)
             for i in range(n)
         ]
     else:
         linkages = []
     clg.sentence_delete(sent)
     return linkages
Beispiel #3
0
def sentence_create(*args) -> "Sentence" :
  return _clinkgrammar.sentence_create(*args)
def sentence_create(*args):
  return _clinkgrammar.sentence_create(*args)
Beispiel #5
0
def sentence_create(input_string, dict):
    return _clinkgrammar.sentence_create(input_string, dict)
Beispiel #6
0
 def __init__(self, text, dict, parse_options):
     self.text, self.dict, self.parse_options = text, dict, parse_options  # keep all args passed into clg.* fn
     self._obj = clg.sentence_create(self.text, self.dict._obj)
 def __init__(self, text, dict, parse_options):
     """
     In python 2.x, txt should be unicode string like u'Bo-bo-bo'
     """
     self.text, self.dict, self.parse_options = text, dict, parse_options  # keep all args passed into clg.* fn
     self._obj = clg.sentence_create(self.text, self.dict._obj)
Beispiel #8
0
def sentence_create(input_string: 'char const *',
                    dict: 'Dictionary') -> "Sentence":
    return _clinkgrammar.sentence_create(input_string, dict)
Beispiel #9
0
 def __init__(self, text, dict, parse_options):
     """
     In python 2.x, txt should be unicode string like u'Bo-bo-bo'
     """
     self.text, self.dict, self.parse_options = text, dict, parse_options  # keep all args passed into clg.* fn
     self._obj = clg.sentence_create(self.text, self.dict._obj)
Beispiel #10
0
 def __init__(self, text, dict, parse_options):
     self.text, self.dict, self.parse_options = text, dict, parse_options  # keep all args passed into clg.* fn
     self._obj = clg.sentence_create(self.text, self.dict._obj)