Overview

Namespaces

  • PHP
  • Sastrawi
    • Dictionary
    • Morphology
      • Disambiguator
    • Specification
    • Stemmer
      • Cache
      • ConfixStripping
      • Context
        • Visitor
      • Filter
    • StopWordRemover

Classes

  • DisambiguatorPrefixRule10
  • DisambiguatorPrefixRule11
  • DisambiguatorPrefixRule12
  • DisambiguatorPrefixRule13a
  • DisambiguatorPrefixRule13b
  • DisambiguatorPrefixRule14
  • DisambiguatorPrefixRule15a
  • DisambiguatorPrefixRule15b
  • DisambiguatorPrefixRule16
  • DisambiguatorPrefixRule17a
  • DisambiguatorPrefixRule17b
  • DisambiguatorPrefixRule17c
  • DisambiguatorPrefixRule18a
  • DisambiguatorPrefixRule18b
  • DisambiguatorPrefixRule19
  • DisambiguatorPrefixRule1a
  • DisambiguatorPrefixRule1b
  • DisambiguatorPrefixRule2
  • DisambiguatorPrefixRule20
  • DisambiguatorPrefixRule21a
  • DisambiguatorPrefixRule21b
  • DisambiguatorPrefixRule23
  • DisambiguatorPrefixRule24
  • DisambiguatorPrefixRule25
  • DisambiguatorPrefixRule26a
  • DisambiguatorPrefixRule26b
  • DisambiguatorPrefixRule27
  • DisambiguatorPrefixRule28a
  • DisambiguatorPrefixRule28b
  • DisambiguatorPrefixRule29
  • DisambiguatorPrefixRule3
  • DisambiguatorPrefixRule30a
  • DisambiguatorPrefixRule30b
  • DisambiguatorPrefixRule30c
  • DisambiguatorPrefixRule31a
  • DisambiguatorPrefixRule31b
  • DisambiguatorPrefixRule32
  • DisambiguatorPrefixRule34
  • DisambiguatorPrefixRule35
  • DisambiguatorPrefixRule36
  • DisambiguatorPrefixRule37a
  • DisambiguatorPrefixRule37b
  • DisambiguatorPrefixRule38a
  • DisambiguatorPrefixRule38b
  • DisambiguatorPrefixRule39a
  • DisambiguatorPrefixRule39b
  • DisambiguatorPrefixRule4
  • DisambiguatorPrefixRule40a
  • DisambiguatorPrefixRule40b
  • DisambiguatorPrefixRule5
  • DisambiguatorPrefixRule6a
  • DisambiguatorPrefixRule6b
  • DisambiguatorPrefixRule7
  • DisambiguatorPrefixRule8
  • DisambiguatorPrefixRule9

Interfaces

  • DisambiguatorInterface
  • Overview
  • Namespace
  • Class
  • Tree
 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: 
API documentation generated by ApiGen 2.8.0