Skip to content

Commit a714128

Browse files
committed
Add docs to speller example
1 parent 9ece114 commit a714128

File tree

1 file changed

+13
-2
lines changed

1 file changed

+13
-2
lines changed

examples/speller.xml

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -138,12 +138,16 @@ True - correct word, false - incorrect word</Description>
138138
return suggestions
139139
]]></Implementation>
140140
</Method>
141-
142141
<Method name="CheckRuString">
142+
<Description><![CDATA[
143+
Checks strings in russian language and writes info about all mistakes in stdout.
144+
String is splitted to words by following rules: all punctuation marks will be replaced by spaces, all symbols except russian cyrillic and hyphen will be stripped, then string is splitted by the spaces.
145+
Return value is the number of mistakes in the string.
146+
]]></Description>
143147
<FormalSpec>str:%String</FormalSpec>
144148
<ReturnType>%Integer</ReturnType>
145149
<Implementation><![CDATA[
146-
set translated = $TRANSLATE(str, ",\/=*:", " ")
150+
set translated = $TRANSLATE(str, ".,\/=*:", " ")
147151
set stripped = $ZSTRIP(translated, "*E", "", " -йцукеёнгшщзхъфывапролджэячсмитьбюЙЦУКЕЁНГШЩЗХЪФЫВАПРОЛДЖЭЯЧСМИТЬБЮ")
148152
set list = $LFS(stripped, " ")
149153
@@ -166,6 +170,12 @@ True - correct word, false - incorrect word</Description>
166170
</Method>
167171

168172
<Method name="CheckLocalization">
173+
<Description><![CDATA[Checks russian localization. By default it checks localization stored in global "^CacheMsg".
174+
If you use $$$TEXT localizaion method, then your local strings are stored exactly in this global. If no you can pass the global that you like.
175+
But this global must have strictly defined structure: on the second level it must have subnode "ru" and all the local strings must be values of "ru" subnodes.
176+
All located mistakes will be stored in file with path <var>file</var> (Default path is "mistakes.txt" in your working directory).
177+
Return value is the number of mistakes in all localization .
178+
]]> </Description>
169179
<FormalSpec>global="^CacheMsg",file="mistakes.txt"</FormalSpec>
170180
<ReturnType>%Integer</ReturnType>
171181
<Implementation><![CDATA[
@@ -199,6 +209,7 @@ True - correct word, false - incorrect word</Description>
199209
]]></Implementation>
200210
</Method>
201211

212+
<Description>Checks system russian localizaion.</Description>
202213
<Method name="CheckSystemLocalization">
203214
<ReturnType>%Integer</ReturnType>
204215
<Implementation><![CDATA[ return ..CheckLocalization("^%qCacheMsg")

0 commit comments

Comments
 (0)