Revision ba2b943...
Go back to digest for 7th August 2011Features in Utilities
Updated journey search analyzers with better autocompletion/correction
- Only add spaces into the output string after a syntax item,
if there was a space in the input string, too. This way, the correction doesn't
get in the way too much. Stored in Lexem.
- Turn struct JourneySearchAnalyzer::Results into an own class
- New function Results::updatedOutputString, which returns an output string with
updated item values and/or added/removed items by type. Used to update the stop
name.
- Calculate cursor position/selection changes on input corrections in the analyzers.
The cursor position can be set on each analyzer and it returns the cursor offset
and selection length to set.
- Add a lookahead iterator, which is always one item after the default iterator.
Maybe this should be removed again?
- Rename SyntacticalAnalyzer::parseX functions to matchX, as they are called to
match something - The parsing happens by calling the right matchX functions.
- These renamed matchX functions now all return true only if they have matched and
move the iterator after the matched item(s).
If they return false, the iterators remain unchanged/get restored.
- New function SyntacticalAnalyzer::matchNumber to match a number in a given range
with good corrections
- Use SyntacticalAnalyzer::matchKeywordInList function also to match prefix keywords
- matchKewordInList now also matches beginnings of keyword, if the cursor position
is after the keyword part (as it is typed in so far). The keyword then gets
completed with the completed part selected.
- Update JourneySearchParserTest, insert into tests/CMakeLists.txt
File Changes
- applet/journeysearchparser.cpp
- applet/journeysearchparser.h
- applet/journeysearchsuggestionwidget.cpp
- applet/journeysearchsuggestionwidget.h
- applet/publictransport.cpp
- applet/tests/CMakeLists.txt
- applet/tests/JourneySearchParserTest.cpp