Add requirements.txt

This commit is contained in:
Jack Stdin 2016-02-13 21:59:37 +03:00
parent 897ea66046
commit 9b8cdf5ad1
4 changed files with 8 additions and 7 deletions

View File

@ -45,6 +45,7 @@ _Внимание_! Только Python 2.7, только PostgreSQL, тольк
`python -m pip install https://github.com/Romamo/sphinxapi/zipball/master` `python -m pip install https://github.com/Romamo/sphinxapi/zipball/master`
### Debian Linux ### Debian Linux
1. Установить unrar 1. Установить unrar
2. Установить sphinxapi последней версии: 2. Установить sphinxapi последней версии:

View File

@ -37,13 +37,13 @@ class FiasFactory:
param), "Invalid parameter value" param), "Invalid parameter value"
if rule == "text": if rule == "text":
assert isinstance(param, str) or isinstance(param, unicode), "Invalid parameter type" assert isinstance(param, str) or isinstance(param, unicode), "Invalid parameter type"
assert len(param) > 3, "Text too short" assert len(param) > 3, "Text too short"
pattern = re.compile(r"[A-za-zА-Яа-я \-,.#№]+") pattern = re.compile(r"[A-za-zА-Яа-я \-,.#№]+")
assert pattern.match(param), "Invalid parameter value" assert pattern.match(param), "Invalid parameter value"
# text - строка поиска # text - строка поиска
# strong - строгий поиск (True) или "мягкий" (False) (с допущением ошибок, опечаток) # strong - строгий поиск (True) или "мягкий" (False) (с допущением ошибок, опечаток)
# Строгий используется при импорте из внешних систем (автоматически), где ошибка критична # Строгий используется при импорте из внешних систем (автоматически), где ошибка критична
def find(self, text, strong=False): def find(self, text, strong=False):
try: try:

View File

@ -16,7 +16,6 @@ class SphinxSearch:
rating_limit_soft = 0.41 rating_limit_soft = 0.41
rating_limit_soft_count = 6 rating_limit_soft_count = 6
word_length_soft = 3
rating_limit_hard = 0.82 rating_limit_hard = 0.82
rating_limit_hard_count = 3 rating_limit_hard_count = 3

View File

@ -90,6 +90,7 @@ class WordEntry:
if not self.scname: if not self.scname:
self.scname = result[2][1] self.scname = result[2][1]
# Проверяем, если слово встречается слишком много раз
if len(result) == 5 and result[4][0] > 30000: if len(result) == 5 and result[4][0] > 30000:
self.is_freq_word = True self.is_freq_word = True