1: <?php
2: /**
3: * Sastrawi (https://github.com/sastrawi/sastrawi)
4: *
5: * @link http://github.com/sastrawi/sastrawi for the canonical source repository
6: * @license https://github.com/sastrawi/sastrawi/blob/master/LICENSE The MIT License (MIT)
7: */
8:
9: namespace Sastrawi\Morphology\Disambiguator;
10:
11: /**
12: * Disambiguate Prefix Rule no 14
13: *
14: * Rule 14 modified by Andy Librian : men{c|d|j|s|t|z} -> men-{c|d|j|s|t|z}
15: * in order to stem mentaati
16: *
17: * Rule 14 modified by ECS: men{c|d|j|s|z} -> men-{c|d|j|s|z}
18: * in order to stem mensyaratkan, mensyukuri
19: *
20: * Original CS Rule no 14 was : men{c|d|j|z} -> men-{c|d|j|z}
21: */
22: class DisambiguatorPrefixRule14 implements DisambiguatorInterface
23: {
24: /**
25: * Disambiguate Prefix Rule no 14
26: *
27: * Rule 14 modified by Andy Librian : men{c|d|j|s|t|z} -> men-{c|d|j|s|t|z}
28: * in order to stem mentaati
29: *
30: * Rule 14 modified by ECS: men{c|d|j|s|z} -> men-{c|d|j|s|z}
31: * in order to stem mensyaratkan, mensyukuri
32: *
33: * Original CS Rule no 14 was : men{c|d|j|z} -> men-{c|d|j|z}
34: */
35: public function disambiguate($word)
36: {
37: $matches = null;
38: $contains = preg_match('/^men([cdjstz])(.*)$/', $word, $matches);
39:
40: if ($contains === 1) {
41: return $matches[1] . $matches[2];
42: }
43: }
44: }
45: