Hello, first of all, thanks for starring!
About using Python dictionaries, the reason is that they allow to
borrow lot of entries in json files.
For example, instead of writing:
# Json
"CAsa": "casa",
"CAse": "case",
"CAsi": "casi",
"CAso": "caso",
etc, we have in the Python file "the letters that can be use to write
these words, but they can be useful to type many many other
expressions. We use an algorythm as follows, similar to the algorythm
used by the original Melani system, with the difference that this is
open source and we had to make a lot of tests to know what Melani
system used the Microsoft Access database, in particular a field named
semplice, used for subsets of characters that can be part of a stroke:
def searchKey(dictionary, stroke):
searchKey = stroke[:]
searchKeyValue = ""
lenSearched = 0
value = ""
while len(searchKey) > 0:
if dictionary.get(searchKey) is not None:
searchKeyValue = dictionary.get(searchKey)[1]
if searchKeyValue == "":
searchKey = searchKey[:len(searchKey) - 1]
else:
value += searchKeyValue
searchKeyValue = ""
lenSearched += len(searchKey)
searchKey = stroke[lenSearched:]
if value == "":
value = "{empty}"
return value
Hope this helps
> --
> You received this message because you are subscribed to the Google Groups
> "Plover" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to
ploversteno...@googlegroups.com.
> To view this discussion on the web visit
>
https://groups.google.com/d/msgid/ploversteno/137c12d9-8772-4bd3-bf42-78c8dbec8a82n%40googlegroups.com.
>