Indexation des films de qualité
This commit is contained in:
parent
75318f75fd
commit
1f5de562be
4 changed files with 101 additions and 49 deletions
|
@ -21,9 +21,9 @@ class Tokenizer:
|
|||
for step in self.steps:
|
||||
for tok in self.get_tokens_step(step):
|
||||
if(not bool(int(tok['case_sensitive']))):
|
||||
reg = re.compile(tok['token'], re.IGNORECASE)
|
||||
reg = re.compile(r' '+tok['token']+r' ', re.IGNORECASE)
|
||||
else:
|
||||
reg = re.compile(tok['token'])
|
||||
reg = re.compile(r' '+tok['token']+r' ')
|
||||
if reg.search(filename):
|
||||
for tok_lang in tok['languages']:
|
||||
found['lang'].append(tok_lang['value'])
|
||||
|
@ -32,6 +32,8 @@ class Tokenizer:
|
|||
for tok_sub in tok['subtitle_languages']:
|
||||
found['subtitle'].append(tok_sub['value'])
|
||||
filename = reg.sub(' ', filename)
|
||||
for typ in found:
|
||||
found[typ] = [e for e in found[typ] if e != 'N/A']
|
||||
return filename, found
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue