Class TurSNSuggestionAutomaton

Object
TurSNSuggestionAutomaton

public class TurSNSuggestionAutomaton extends Object
The SuggestionAutomaton class represents a finite state machine used to validate suggestions.

Methods:

Since:
0.3.9
Author:
Gabriel F. Gomazako
  • Field Details

  • Constructor Details

    • TurSNSuggestionAutomaton

      public TurSNSuggestionAutomaton()
  • Method Details

    • isAddSuggestion

      public boolean isAddSuggestion(String suggestion, int numberOfWordsFromQuery, List<String> stopWords)
      Runs the suggestion automaton to determine if a given suggestion is valid.
      Parameters:
      suggestion - the suggestion string to be evaluated.
      numberOfWordsFromQuery - the number of words from the current query. It will be used to know how many words the suggestion should have.
      stopWords - a list of stop words.
      Returns:
      true if the suggestion is valid, according to the automaton rules, false otherwise.