1
0
mirror of https://github.com/gnosygnu/xowa.git synced 2026-03-02 03:49:30 +00:00
This commit is contained in:
gnosygnu
2015-08-03 00:10:03 -04:00
parent 9d63f03b3d
commit 34c34f227c
514 changed files with 4972 additions and 3910 deletions

View File

@@ -20,7 +20,7 @@ import gplx.core.primitives.*; import gplx.core.btries.*;
public class Xol_grammar_ {
public static final byte Tid__max = 9;
public static final byte Tid_genitive = 0, Tid_elative = 1, Tid_partitive = 2, Tid_illative = 3, Tid_inessive = 4, Tid_accusative = 5, Tid_instrumental = 6, Tid_prepositional = 7, Tid_dative = 8, Tid_unknown = Byte_.Max_value_127;
private static final Btrie_slim_mgr Tid_trie = Btrie_slim_mgr.ci_ascii_() // NOTE:ci.ascii:MW kwds
private static final Btrie_slim_mgr Tid_trie = Btrie_slim_mgr.ci_a7() // NOTE:ci.ascii:MW kwds
.Add_str_byte("genitive", Tid_genitive)
.Add_str_byte("elative", Tid_elative)
.Add_str_byte("partitive", Tid_partitive)

View File

@@ -17,6 +17,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package gplx.xowa.langs.grammars; import gplx.*; import gplx.xowa.*; import gplx.xowa.langs.*;
import gplx.core.primitives.*; import gplx.core.btries.*;
import gplx.xowa.urls.*;
public class Xol_grammar_fi implements Xol_grammar {
public boolean Vowel_harmony(byte[] word, int word_len) {
// $aou = preg_match( '/[aou][^äöy]*$/i', $word );
@@ -53,7 +54,7 @@ public class Xol_grammar_fi implements Xol_grammar {
byte[] lower = lang.Case_mgr().Case_build_lower(word, 0, word_len);
boolean aou = Vowel_harmony(lower, word_len);
// PHP: if ( preg_match( '/wiki$/i', $word ) ) $aou = false;
if (aou && Bry_.Has_at_end(lower, Xoa_url_parser.Bry_wiki_name))
if (aou && Bry_.Has_at_end(lower, Bry_wiki))
aou = false;
// PHP: if ( preg_match( '/[bcdfghjklmnpqrstvwxz]$/i', $word ) ) $word .= 'i';
switch (lower[word_len - 1]) {
@@ -76,5 +77,6 @@ public class Xol_grammar_fi implements Xol_grammar {
} static Xol_grammar_manual_regy manual_regy;
private static final byte[] Bry_sta_y = Bry_.new_a7("sta"), Bry_sta_n = Bry_.new_u8("stä"), Bry_a_y = Bry_.new_a7("a"), Bry_a_n = Bry_.new_u8("ä"), Bry_ssa_y = Bry_.new_a7("ssa"), Bry_ssa_n = Bry_.new_u8("ssä");
static final byte Trie_vh_back = 0, Trie_vh_front = 1;
private static Btrie_slim_mgr trie_vh = Btrie_slim_mgr.cs_().Add_str_byte__many(Trie_vh_back, "a", "o", "u").Add_str_byte__many(Trie_vh_front, "ä", "ö", "y");
private static Btrie_slim_mgr trie_vh = Btrie_slim_mgr.cs().Add_str_byte__many(Trie_vh_back, "a", "o", "u").Add_str_byte__many(Trie_vh_front, "ä", "ö", "y");
private static final byte[] Bry_wiki = Bry_.new_a7("wiki");
}

View File

@@ -25,7 +25,7 @@ public class Xol_grammar_manual_regy {
public Xol_grammar_manual_regy Itms_add(byte type_tid, String orig, String repl) {
Hash_adp_bry hash = ary[type_tid];
if (hash == null) {
hash = Hash_adp_bry.ci_ascii_(); // ASCII:currently only being used for Wikiuutiset; DATE:2014-07-07
hash = Hash_adp_bry.ci_a7(); // ASCII:currently only being used for Wikiuutiset; DATE:2014-07-07
ary[type_tid] = hash;
}
hash.Add_str_obj(orig, Bry_.new_a7(repl));