Fix only complete word problem
Browse files
app.py
CHANGED
@@ -475,21 +475,21 @@ def search_spec(request: KeywordRequest):
|
|
475 |
docValid = not isinstance(doc, str)
|
476 |
|
477 |
if request.mode == "and":
|
478 |
-
if all(kw in willLower(string, booleanLowered)
|
479 |
put = True
|
480 |
if docValid:
|
481 |
for chapter in list(doc.keys())[1:]:
|
482 |
if "references" not in chapter.lower():
|
483 |
-
if all(kw in willLower(doc[chapter], booleanLowered)
|
484 |
put = True
|
485 |
contents.append(chapter)
|
486 |
elif request.mode == "or":
|
487 |
-
if any(kw in willLower(string, booleanLowered)
|
488 |
put = True
|
489 |
if docValid:
|
490 |
for chapter in list(doc.keys())[1:]:
|
491 |
if "references" not in chapter.lower():
|
492 |
-
if any(kw in willLower(doc[chapter], booleanLowered)
|
493 |
put = True
|
494 |
contents.append(chapter)
|
495 |
|
|
|
475 |
docValid = not isinstance(doc, str)
|
476 |
|
477 |
if request.mode == "and":
|
478 |
+
if all(kw in willLower(string, booleanLowered) for kw in kws):
|
479 |
put = True
|
480 |
if docValid:
|
481 |
for chapter in list(doc.keys())[1:]:
|
482 |
if "references" not in chapter.lower():
|
483 |
+
if all(kw in willLower(doc[chapter], booleanLowered) for kw in kws):
|
484 |
put = True
|
485 |
contents.append(chapter)
|
486 |
elif request.mode == "or":
|
487 |
+
if any(kw in willLower(string, booleanLowered) for kw in kws):
|
488 |
put = True
|
489 |
if docValid:
|
490 |
for chapter in list(doc.keys())[1:]:
|
491 |
if "references" not in chapter.lower():
|
492 |
+
if any(kw in willLower(doc[chapter], booleanLowered) for kw in kws):
|
493 |
put = True
|
494 |
contents.append(chapter)
|
495 |
|