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 12
13: * Nazief and Adriani Rule 12 : mempe{r|l} -> mem-pe{r|l}
14: * Modified by Jelita Asian's CS Rule 12 : mempe -> mem-pe to stem mempengaruhi
15: */
16: class DisambiguatorPrefixRule12 implements DisambiguatorInterface
17: {
18: /**
19: * Disambiguate Prefix Rule 12
20: * Nazief and Adriani Original Rule 12 : mempe{r|l} -> mem-pe{r|l}
21: * Modified by Jelita Asian's CS Rule 12 : mempe -> mem-pe to stem mempengaruhi
22: */
23: public function disambiguate($word)
24: {
25: $matches = null;
26: $contains = preg_match('/^mempe(.*)$/', $word, $matches);
27:
28: if ($contains === 1) {
29: return 'pe' . $matches[1];
30: }
31: }
32: }
33: