k8ieone / rugl

Random Unwise Generic Library (of random unwise generic programs)
MIT License
1 stars 0 forks source link

[pylogin] A dictionary with language variants #14

Closed k8ieone closed 2 years ago

k8ieone commented 5 years ago

We may be able to do an infinite number of translations like this. This could be applied to any program.

Below code is just an example.

if lang == "cz":
        dictionary{"hello"} = "ahoj"
        dictionary{"world"} = "svět"
else:
        dictionary{"hello"} = "hello"
        dictionary{"world"} = "world"
print (dictionary.get("hello"),dictionary.get("world"))
k8ieone commented 5 years ago

Also there would have to be some mechanism to support inflection (skloňování). Example would print "ahoj svět" instead of the desired "Ahoj světe!"