예제 #1
0
파일: service.py 프로젝트: JoyCTsai/loso
 def splitTerms(self, text, categories=None):
     """Split text into terms
     
     """
     terms = []
     for sentence in lexicon.splitSentence(text):
         if sentence:
             for mixed in lexicon.iterMixTerms(sentence):
                 # English term
                 if mixed.startswith('E'):
                     terms.append(mixed)
                 # Chinese sentence
                 else:
                     terms.extend(self.db.splitTerms(mixed, categories))
     return terms
예제 #2
0
파일: service.py 프로젝트: wise-X/loso
 def splitTerms(self, text, categories=None):
     """Split text into terms
     
     """
     terms = []
     for sentence in lexicon.splitSentence(text):
         if sentence:
             for mixed in lexicon.iterMixTerms(sentence):
                 # English term
                 if mixed.startswith('E'):
                     terms.append(mixed)
                 # Chinese sentence
                 else:
                     terms.extend(self.db.splitTerms(mixed, categories))
     return terms
예제 #3
0
파일: service.py 프로젝트: JoyCTsai/loso
 def splitNgramTerms(self, text):
     """Split text into 1 to n gram terms
     
     """
     terms = []
     for sentence in lexicon.splitSentence(text):
         if sentence:
             for mixed in lexicon.iterMixTerms(sentence):
                 # English term
                 if mixed.startswith('E'):
                     terms.append(mixed)
                 # Chinese sentence
                 else:
                     for n in xrange(1, self.ngram+1):
                         terms.extend(lexicon.iterTerms(n, mixed, False))
     return terms
예제 #4
0
파일: service.py 프로젝트: wise-X/loso
 def splitNgramTerms(self, text):
     """Split text into 1 to n gram terms
     
     """
     terms = []
     for sentence in lexicon.splitSentence(text):
         if sentence:
             for mixed in lexicon.iterMixTerms(sentence):
                 # English term
                 if mixed.startswith('E'):
                     terms.append(mixed)
                 # Chinese sentence
                 else:
                     for n in xrange(1, self.ngram + 1):
                         terms.extend(lexicon.iterTerms(n, mixed, False))
     return terms
예제 #5
0
파일: service.py 프로젝트: JoyCTsai/loso
 def splitSentence(self, text):
     """Split text into sentence
     
     """
     return lexicon.splitSentence(text)
예제 #6
0
파일: service.py 프로젝트: wise-X/loso
 def splitSentence(self, text):
     """Split text into sentence
     
     """
     return lexicon.splitSentence(text)
예제 #7
0
 def splitSentence(self, text):
     '''Split text into sentence
     
     '''
     return lexicon.splitSentence(text)