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 1b
13: * Rule 1a : berV -> be-rV
14: */
15: class DisambiguatorPrefixRule1b implements DisambiguatorInterface
16: {
17: /**
18: * Disambiguate Prefix Rule 1b
19: * Rule 1b : berV -> be-rV
20: * @return string
21: */
22: public function disambiguate($word)
23: {
24: $matches = null;
25: $contains = preg_match('/^ber([aiueo].*)$/', $word, $matches);
26:
27: if ($contains === 1) {
28: return 'r' . $matches[1];
29: }
30: }
31: }
32: