summaryrefslogtreecommitdiff
path: root/pythonpath
diff options
context:
space:
mode:
authorLászló Németh <nemeth@numbertext.org>2018-01-17 10:54:34 +0100
committerLászló Németh <nemeth@numbertext.org>2018-01-17 10:54:34 +0100
commitedfac327f69ae50d73dcaaffcbde5152e16e6e89 (patch)
treeecc65174247f61471922c48e793f3347855a393a /pythonpath
parentc775f5f97f5051ffe28909d59ab8c7b289a62205 (diff)
support lower case suggestions for capitalized patterns:
Start the suggestion with the character sequence "!CASE!". Rule example: Foo -> !CASE!foo # Did you mean: or in multiple suggestions Foo -> FOO|!CASE!foo # Did you mean: (FOO and foo suggestions for the input word "Foo", instead of FOO and the capitalized Foo)
Diffstat (limited to 'pythonpath')
-rw-r--r--pythonpath/lightproof_impl___implname__.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/pythonpath/lightproof_impl___implname__.py b/pythonpath/lightproof_impl___implname__.py
index bab4e9d..5b76e17 100644
--- a/pythonpath/lightproof_impl___implname__.py
+++ b/pythonpath/lightproof_impl___implname__.py
@@ -193,8 +193,10 @@ def proofread( nDocId, TEXT, LOCALE, nStartOfSentencePos, nSuggestedSentenceEndP
return tuple(aErrs)
def cap(a, iscap, rLoc):
- if iscap:
- for i in range(0, len(a)):
+ for i in range(0, len(a)):
+ if a[i][0:6] == "!CASE!":
+ a[i] = a[i][6:]
+ elif iscap:
if a[i][0:1] == "i":
if rLoc.Language == "tr" or rLoc.Language == "az":
a[i] = u"\u0130" + a[i][1:]