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 19
13: * Original Rule 19 : mempV -> mem-pV where V != 'e'
14: * Modified Rule 19 by ECS : mempA -> mem-pA where A != 'e' in order to stem memproteksi
15: */
16: class DisambiguatorPrefixRule19 implements DisambiguatorInterface
17: {
18: /**
19: * Disambiguate Prefix Rule 19
20: * Original Rule 19 : mempV -> mem-pV where V != 'e'
21: * Modified Rule 19 by ECS : mempA -> mem-pA where A != 'e' in order to stem memproteksi
22: */
23: public function disambiguate($word)
24: {
25: if (preg_match('/^memp([abcdfghijklmopqrstuvwxyz])(.*)$/', $word, $matches)) {
26: return 'p' . $matches[1] . $matches[2];
27: }
28: }
29: }
30: