Улучшен поиск, правки кода.

This commit is contained in:
Jack Stdin
2016-02-02 13:27:42 +03:00
parent 90cae604fa
commit 8088bff07a
13 changed files with 107 additions and 46 deletions

View File

@@ -0,0 +1,6 @@
# -*- coding: utf-8 -*-
class FiasException(Exception):
def __str__(self):
return repr(self.args[0])

View File

@@ -85,8 +85,7 @@ class SphinxHelper:
splitting_seq = line.split(' ')
keyword = splitting_seq[0]
freq = splitting_seq[1].rstrip('\n')
if not keyword or not freq:
raise BaseException("Cannot process {}".format(self.files['dict.txt']))
assert keyword and freq, "Cannot process {}".format(self.files['dict.txt'])
nodes.append(keyword)
nodes.append(trigram(keyword))