Exemple #1
0
 /**
  * Constructor
  *
  * @return void
  * */
 public function __construct()
 {
     $stemmerFactory = new \Sastrawi\Stemmer\StemmerFactory();
     $this->stemmer = $stemmerFactory->createStemmer();
     $stopWordRemoverFactory = new \Sastrawi\StopWordRemover\StopWordRemoverFactory();
     $this->StopWordRemover = $stopWordRemoverFactory->createStopWordRemover();
     $sentenceDetectorFactory = new SentenceDetectorFactory();
     $this->sentenceDetector = $sentenceDetectorFactory->createSentenceDetector();
     $tokenizerFactory = new TokenizerFactory();
     $this->tokenizer = $tokenizerFactory->createDefaultTokenizer();
 }
 public function testCreateSentenceDetector()
 {
     $factory = new SentenceDetectorFactory();
     $sd = $factory->createSentenceDetector();
     $this->assertInstanceOf('Sastrawi\\SentenceDetector\\SentenceDetector', $sd);
 }
 /**
  * Initializes context.
  *
  * Every scenario gets its own context instance.
  * You can also pass arbitrary arguments to the
  * context constructor through behat.yml.
  */
 public function __construct()
 {
     $sentenceDetectorFactory = new SentenceDetectorFactory();
     $this->sentenceDetector = $sentenceDetectorFactory->createSentenceDetector();
 }