mirror of
https://github.com/getzep/graphiti.git
synced 2025-06-27 02:00:02 +00:00
update lucene escaping (#233)
* update lucene escaping * update unit test
This commit is contained in:
parent
8858be8cef
commit
732b2f328d
@ -57,6 +57,12 @@ def lucene_sanitize(query: str) -> str:
|
|||||||
':': r'\:',
|
':': r'\:',
|
||||||
'\\': r'\\',
|
'\\': r'\\',
|
||||||
'/': r'\/',
|
'/': r'\/',
|
||||||
|
'O': r'\O',
|
||||||
|
'R': r'\R',
|
||||||
|
'N': r'\N',
|
||||||
|
'T': r'\T',
|
||||||
|
'A': r'\A',
|
||||||
|
'D': r'\D',
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -23,10 +23,10 @@ def test_lucene_sanitize():
|
|||||||
# Call the function with test data
|
# Call the function with test data
|
||||||
queries = [
|
queries = [
|
||||||
(
|
(
|
||||||
'This has every secape character + - && || ! ( ) { } [ ] ^ " ~ * ? : \\ /',
|
'This has every escape character + - && || ! ( ) { } [ ] ^ " ~ * ? : \\ /',
|
||||||
'This has every secape character \+ \- \&\& \|\| \! \( \) \{ \} \[ \] \^ \\" \~ \* \? \: \\\ \/',
|
'\This has every escape character \+ \- \&\& \|\| \! \( \) \{ \} \[ \] \^ \\" \~ \* \? \: \\\ \/',
|
||||||
),
|
),
|
||||||
('This has no escape characters', 'This has no escape characters'),
|
('this has no escape characters', 'this has no escape characters'),
|
||||||
]
|
]
|
||||||
|
|
||||||
for query, assert_result in queries:
|
for query, assert_result in queries:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user