wiki.techinc.nl/languages/data/grammarTransformations/ru.json
Amir E. Aharoni df5a848de8 Make grammar data loadable as an RL module and usable in JS
* Load the data of this variable from a JSON file to the same
  data structure that ResourceLoader uses for digitTransformTable,
  pluralRules, etc.
* Change the JSON structure to ensure the order of the rules.
  Otherwise JavaScript processes the keys in a random order.
* Delete the grammar code from JS and replace it with
  the same logic that is used in PHP for processing the data.

For now this is done only for Russian.

The next step will be to make the PHP and JS
data processing logic reusable.

Bug: T115217
Change-Id: I6b9b29b7017f958d62611671be017f97cee73415
2016-10-21 12:25:16 -07:00

57 lines
1.7 KiB
JSON
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

{
"@metadata": {
"authors": [
"Alexander Sigachov (alexander.sigachov at Googgle Mail)",
"Amir E. Aharoni (amir.aharoni@mail.huji.ac.il)"
],
"comment": "These rules don't cover the whole grammar of the language, and are intended only for names of languages and Wikimedia projects."
},
"genitive": [
[ "(.+)ь$", "$1я" ],
[ "(.+)ия$", "$1ии" ],
[ "(.+)ка$", "$1ки" ],
[ "(.+)ти$", "$1тей" ],
[ "(.+)ды$", "$1дов" ],
[ "(.+)д$", "$1да" ],
[ "(.+)ник$", "$1ника" ],
[ "(.+)ные$", "$1ных" ]
],
"prepositional": [
[ "(.+)ь$", "$1е" ],
[ "(.+)ия$", "$1ии" ],
[ "(.+)ка$", "$1ке" ],
[ "(.+)ти$", "$1тях" ],
[ "(.+)ды$", "$1дах" ],
[ "(.+)д$", "$1де" ],
[ "(.+)ник$", "$1нике" ],
[ "(.+)ные$", "$1ных" ]
],
"languagegen": [
[ "@metadata", [
"comment", "язык в родительном падеже: '(с) русского'"
] ],
[ "(.+)кий$", "$1кого" ],
[ "иврит$", "иврита" ],
[ "идиш$", "идиша" ],
[ "(.+)$", "$1" ]
],
"languageprep": [
[ "@metadata", [
"comment", "язык в предложном падеже: '(на) русском'"
] ],
[ "(.+)кий$", "$1ком" ],
[ "иврит$", "иврите" ],
[ "идиш$", "идише" ],
[ "(.+)$", "$1" ]
],
"languageadverb": [
[ "@metadata", [
"comment", "наречие с названием языка: 'по-русски'"
] ],
[ "(.+)кий$", "по-$1ки" ],
[ "иврит$", "на иврите" ],
[ "идиш$", "на идише" ],
[ "(идо|урду|хинди|эсперанто)$", "на $1" ],
[ "(.+)$", "на языке $1" ]
]
}