Interface Dictionary

All Superinterfaces:
Iterable<String>
All Known Subinterfaces:
Abbreviations, Punctuations, StopWords
All Known Implementing Classes:
EnglishDictionary, EnglishPunctuations, EnglishStopWords, SimpleDictionary

public interface Dictionary extends Iterable<String>
A dictionary is a set of words in some natural language.
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    Returns true if this dictionary contains the specified word.
    Returns an iterator over the words in this dictionary.
    int
    Returns the number of words in this dictionary.
    default Stream<String>
    Returns a sequential stream of the words in this dictionary.

    Methods inherited from interface Iterable

    forEach, spliterator
  • Method Details

    • contains

      boolean contains(String word)
      Returns true if this dictionary contains the specified word.
      Parameters:
      word - the query word.
      Returns:
      true if this dictionary contains the specified word.
    • size

      int size()
      Returns the number of words in this dictionary.
      Returns:
      the number of words in this dictionary.
    • iterator

      Iterator<String> iterator()
      Returns an iterator over the words in this dictionary.
      Specified by:
      iterator in interface Iterable<String>
      Returns:
      the iterator.
    • stream

      default Stream<String> stream()
      Returns a sequential stream of the words in this dictionary.
      Returns:
      a stream of words.