com.languagecomputer.api.query
Interface Keyword

All Known Implementing Classes:
DefaultKeyword

public interface Keyword

Representation of a keyword. Allows keywords to be any string. Contains several properties that may optionally be supported:

Since:
1.0
Author:
Kirk Roberts

Method Summary
 String getRawString()
          Returns the raw String (unstemmed) for this Keyword (required).
 double getWeight()
          Returns the weight for this Keyword (optional operation).
 boolean isExact()
          Indicates this Keyword should not be stemmed (optional operation).
 boolean isMandatory()
          Indicates this Keyword is mandatory (optional operation).
 

Method Detail

getRawString

String getRawString()
Returns the raw String (unstemmed) for this Keyword (required).

Returns:
A raw String representation of this Keyword.

getWeight

double getWeight()
Returns the weight for this Keyword (optional operation). The weight must be on a scale of 0.0 (exclusive) to 1.0 (inclusive). If determining keyword weights is not possible, a weight of 1.0 should be given.

Returns:
The (0.0-1.0] weight of this Keyword.

isMandatory

boolean isMandatory()
Indicates this Keyword is mandatory (optional operation). The default should be false.

Returns:
true if this Keyword must be included in any results to a Query, false otherwise.

isExact

boolean isExact()
Indicates this Keyword should not be stemmed (optional operation). The default should be false.

Returns:
true if this Keyword should not be stemmed for searches, false otherwise.


Copyright © 2009. All Rights Reserved.