Package com.viglet.turing.sn.ac
Class TurSNSuggestionAutomaton
Object
TurSNSuggestionAutomaton
The SuggestionAutomaton class represents a finite state machine used to
validate suggestions.
Methods:
TurSNSuggestionAutomaton()
: Constructor that builds the automaton.isAddSuggestion(String, int, List)
: Runs the automaton on a given suggestion, number of words from query, and stop words list.getTokenType(List, String)
: Determines the token type of a given token.
- Since:
- 0.3.9
- Author:
- Gabriel F. Gomazako
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionboolean
isAddSuggestion
(String suggestion, int numberOfWordsFromQuery, List<String> stopWords) Runs the suggestion automaton to determine if a given suggestion is valid.
-
Field Details
-
ACCEPT
- See Also:
-
ERROR
- See Also:
-
FIRST_TERM_OR_STOP_WORD
- See Also:
-
PREVIOUS_TERM_IS_WORD
- See Also:
-
-
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.
-