PHP Класс Sastrawi\Dictionary\ArrayDictionary

Наследование: implements Sastrawi\Dictionary\DictionaryInterface
Показать файл Открыть проект Примеры использования класса

Защищенные свойства (Protected)

Свойство Тип Описание
$words string[]

Открытые методы

Метод Описание
__construct ( array $words = [] )
add ( string $word ) : void Add a word to the dictionary
addWords ( array $words ) : void Add multiple words to the dictionary
addWordsFromTextFile ( $filePath, $delimiter = " " ) : void Add words from a text file to the dictionary
contains ( $word )
count ( )
remove ( string $word ) : void Remove a word from the dictionary

Описание методов

__construct() публичный Метод

public __construct ( array $words = [] )
$words array

add() публичный Метод

Add a word to the dictionary
public add ( string $word ) : void
$word string
Результат void

addWords() публичный Метод

Add multiple words to the dictionary
public addWords ( array $words ) : void
$words array
Результат void

addWordsFromTextFile() публичный Метод

Add words from a text file to the dictionary
public addWordsFromTextFile ( $filePath, $delimiter = " " ) : void
Результат void

contains() публичный Метод

public contains ( $word )

count() публичный Метод

public count ( )

remove() публичный Метод

Remove a word from the dictionary
public remove ( string $word ) : void
$word string
Результат void

Описание свойств

$words защищенное свойство

protected string[] $words
Результат string[]