Sastrawi\Dictionary\ArrayDictionary::count PHP Method

count() public method

public count ( )
    public function count()
    {
        return count($this->words);
    }

Usage Example

 public function testConstructorPreserveWords()
 {
     $words = array('word1', 'word2');
     $dictionary = new ArrayDictionary($words);
     $this->assertEquals(2, $dictionary->count());
     $this->assertTrue($dictionary->contains('word1'));
     $this->assertTrue($dictionary->contains('word2'));
 }