net.sf.eos.search
Class UserQueryParser
java.lang.Object
net.sf.eos.search.UserQueryParser
- All Implemented Interfaces:
- Function<String,List<String>>
public class UserQueryParser
- extends Object
- implements Function<String,List<String>>
Simple splitter for user search queries. User search queries must be very
simple to understand (for the most users, not for power user).
A search query is a quantity of phrases. A term is a literal without any
whitespace character. Whitespace characters are the delimiter of the terms
in a search query. A compound is a quantity of terms enclosed by two
ASCII 0x22 (") characters called phrase. The processor}}
returns a list of terms and phrases in order of there index position in
the query. The processor removes ASCII 0x22 characters an
normalizes following whitespace characters to only one
ASCII 0x20 character. All whitespace characters other
than ASCII 0x20 will normalized to
ASCII 0x20. Newlines were removed if possible. If the
character count of ASCII 0x22 is odd, the last
ASCII 0x22 will be part of a term or a single term.
- Author:
- Sascha Kohlmann
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
UserQueryParser
public UserQueryParser()
apply
public List<String> apply(String query)
- Splits the user query in different terms and phrases.
- Specified by:
apply
in interface Function<String,List<String>>
- Parameters:
query
- the users search query
- Returns:
- Array with different search information
Copyright © 2008. All Rights Reserved.