diff options
-rw-r--r-- | doc/syntax.txt | 13 | ||||
-rw-r--r-- | pythonpath/lightproof_impl___implname__.py | 6 |
2 files changed, 17 insertions, 2 deletions
diff --git a/doc/syntax.txt b/doc/syntax.txt index be280b8..bcca2be 100644 --- a/doc/syntax.txt +++ b/doc/syntax.txt @@ -98,6 +98,19 @@ Example: foobar -> _ # Message +== Avoid automatic capitalization of suggestions == + +Start the suggestion with the character sequence "!CASE!": + +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) + == Longer explanations == Warning messages can contain optional URLs for longer explanations separated by "|" or "\n": 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:] |