Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New Verbal Succinct Transition Instruction #2844

Closed
wants to merge 55 commits into from
Closed
Changes from 1 commit
Commits
Show all changes
55 commits
Select commit Hold shift + click to select a range
7b2ab37
added new verbal_succinct_transition_instruction logic to maneuver, m…
kdiluca Feb 8, 2021
6d2ba97
fixed imports and check if streetnames exist per maneuver
kdiluca Feb 8, 2021
a337ab9
added more testing
kdiluca Feb 9, 2021
2fb15b3
fixed FormVerbalSuccinctStartTransitionInstruction
kdiluca Feb 9, 2021
f248903
Merge branch 'master' into kdiluca-long-streetnames
kdiluca Feb 9, 2021
39b1f5c
Merge remote-tracking branch 'origin/master' into kdiluca-long-street…
kdiluca Feb 10, 2021
a233607
Merge remote-tracking branch 'origin/master' into kdiluca-long-street…
kdiluca Feb 10, 2021
8a07c27
reorganized and updated narrativebuilder test
kdiluca Feb 10, 2021
4fccdc0
lint
kdiluca Feb 10, 2021
5da6131
more test edits
kdiluca Feb 10, 2021
756195d
update tests with succinct logic updates
kdiluca Feb 16, 2021
30b46c7
Merge remote-tracking branch 'origin/master' into kdiluca-long-street…
kdiluca Feb 16, 2021
56d963e
fixed formatting
kdiluca Feb 16, 2021
ee34ff7
fixed formatting
kdiluca Feb 16, 2021
dc944bb
updated changelog
kdiluca Feb 16, 2021
92f41c1
removing maneuver where not needed for now
kdiluca Feb 16, 2021
a3e4fd7
updated gurka tests
kdiluca Feb 17, 2021
2a3a217
Merge remote-tracking branch 'origin/master' into kdiluca-long-street…
kdiluca Feb 17, 2021
fcd44ac
Merge branch 'master' into kdiluca-long-streetnames
kdiluca Feb 22, 2021
ef9d7e9
Merge branch 'master' into kdiluca-long-streetnames
kdiluca Mar 2, 2021
303a36d
Merge remote-tracking branch 'origin/master' into kdiluca-long-street…
kdiluca Mar 2, 2021
ff714bd
Merge branch 'kdiluca-long-streetnames' of github.com:valhalla/valhal…
kdiluca Mar 2, 2021
696141b
updates
kdiluca Mar 2, 2021
0d279a8
refactor
kdiluca Mar 2, 2021
4751108
refactor
kdiluca Mar 2, 2021
d76217f
update ProcessVerbalSuccinctTransitionInstruction for street name count
dgearhart Mar 2, 2021
e39627b
Addded flag succinct flag for milticue
dgearhart Mar 2, 2021
8b66f77
Added call to process multicue for succinct
dgearhart Mar 2, 2021
3affd3e
Updated to make sure succinct exists before setting multicue
dgearhart Mar 2, 2021
c85781d
typo
dgearhart Mar 2, 2021
a567062
Merge remote-tracking branch 'origin/master' into kdiluca-long-street…
kdiluca Mar 4, 2021
591786a
fixed tests for succinct
kdiluca Mar 4, 2021
4cdc9ae
long street names test
kdiluca Mar 4, 2021
de749d5
update street name length threshold
kdiluca Mar 5, 2021
0f3ebc2
added missing breaks
dgearhart Mar 5, 2021
51af4a9
Changed back to 25 for kMaxStreetNameLength
dgearhart Mar 5, 2021
8ebd4d1
adding word length and count functions to util odin
kdiluca Apr 19, 2021
6c8f7d0
added Japenese tests
kdiluca Apr 19, 2021
6376d04
Merge remote-tracking branch 'origin/master' into kdiluca-strlen
kdiluca Apr 19, 2021
6527509
updated changelog
kdiluca Apr 19, 2021
6ea65d4
fixed merged conflict
kdiluca Apr 19, 2021
dbc58cd
updated util with new utf-8 strlen functions
kdiluca Apr 19, 2021
5024d83
updated to use new strlen function and added towards to succinct inst…
kdiluca Apr 19, 2021
ab33787
fix conflicts after master merge
kdiluca Apr 20, 2021
86d93c6
removed unused succinct functions and fixed destination succinct use
kdiluca Apr 21, 2021
71ceba7
updating tests for succinct
kdiluca Apr 21, 2021
0edc7b3
Merge remote-tracking branch 'origin/master' into kdiluca-long-street…
kdiluca Apr 22, 2021
dbd8e7a
fixed FormVerbalSuccinctDestinationTransitionInstruction to use relat…
kdiluca Apr 22, 2021
685665c
update
kdiluca Apr 22, 2021
ca8141a
Merge remote-tracking branch 'origin/master' into kdiluca-long-street…
kdiluca Apr 22, 2021
c7076dd
Merge remote-tracking branch 'origin/master' into kdiluca-long-street…
kdiluca Apr 22, 2021
edccd19
removed the setting of succinct if we are currently not going to use it
kdiluca Apr 22, 2021
68640de
Merge remote-tracking branch 'origin/master' into kdiluca-long-street…
kdiluca May 28, 2021
79166c8
Merge remote-tracking branch 'origin/master' into kdiluca-long-street…
kdiluca Jun 1, 2021
221e5d5
removed succinct enter ferry and succinct keep and adjusted tests acc…
kdiluca Jun 1, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fixed FormVerbalSuccinctStartTransitionInstruction
  • Loading branch information
kdiluca committed Feb 9, 2021
commit 2fb15b3c5c7586a98cbb30ea22edf9f4b4fcff91
24 changes: 18 additions & 6 deletions src/odin/narrativebuilder.cc
Original file line number Diff line number Diff line change
Expand Up @@ -3870,9 +3870,13 @@ std::string NarrativeBuilder::FormVerbalPostTransitionTransitInstruction(Maneuve

std::string NarrativeBuilder::FormVerbalSuccinctStartTransitionInstruction(Maneuver& maneuver) {
// "0": "Head <CARDINAL_DIRECTION>.",
// "1": "Drive <CARDINAL_DIRECTION>.",
// "2": "Walk <CARDINAL_DIRECTION>.",
// "3": "Bike <CARDINAL_DIRECTION>."
// "1": "Head <CARDINAL_DIRECTION> for <LENGTH>.",
// "5": "Drive <CARDINAL_DIRECTION>.",
// "6": "Drive <CARDINAL_DIRECTION> for <LENGTH>.",
// "10": "Walk <CARDINAL_DIRECTION>.",
// "11": "Walk <CARDINAL_DIRECTION> for <LENGTH>.",
// "15": "Bike <CARDINAL_DIRECTION>."
// "16": "Bike <CARDINAL_DIRECTION> for <LENGTH>.",

std::string instruction;
instruction.reserve(kInstructionInitialCapacity);
Expand All @@ -3886,18 +3890,26 @@ std::string NarrativeBuilder::FormVerbalSuccinctStartTransitionInstruction(Maneu

// Set base phrase id per mode
if (maneuver.travel_mode() == TripLeg_TravelMode_kDrive) {
phrase_id += 1;
phrase_id += 5;
} else if (maneuver.travel_mode() == TripLeg_TravelMode_kPedestrian) {
phrase_id += 2;
phrase_id += 10;
} else if (maneuver.travel_mode() == TripLeg_TravelMode_kBicycle) {
phrase_id += 3;
phrase_id += 15;
}

if (maneuver.include_verbal_pre_transition_length()) {
// Increment phrase id for length
phrase_id += 1;
}

// Set instruction to the determined tagged phrase
instruction = dictionary_.start_verbal_subset.phrases.at(std::to_string(phrase_id));

// Replace phrase tags with values
boost::replace_all(instruction, kCardinalDirectionTag, cardinal_direction);
boost::replace_all(instruction, kLengthTag,
FormLength(maneuver, dictionary_.start_verbal_subset.metric_lengths,
dictionary_.start_verbal_subset.us_customary_lengths));

// If enabled, form articulated prepositions
if (articulated_preposition_enabled_) {
Expand Down