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 27
13: * Rule 27 : pen{c|d|j|z} -> pen-{c|d|j|z}
14: */
15: class DisambiguatorPrefixRule27 implements DisambiguatorInterface
16: {
17: /**
18: * Disambiguate Prefix Rule 27
19: * Rule 27 : pen{c|d|j|z} -> pen-{c|d|j|z}
20: */
21: public function disambiguate($word)
22: {
23: if (preg_match('/^pen([cdjz])(.*)$/', $word, $matches)) {
24: return $matches[1] . $matches[2];
25: }
26: }
27: }
28: