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
Show file tree
Hide file tree
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
updated gurka tests
  • Loading branch information
kdiluca committed Feb 17, 2021
commit a3e4fd729a5513f6afb446f15c2c56f2e70561d5
2 changes: 1 addition & 1 deletion src/odin/maneuversbuilder.cc
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ constexpr float kSmallEndRampForkThreshold = 0.125f;

// Thresholds for succinct phrase usage
constexpr uint32_t kMaxWordCount = 5;
constexpr uint32_t kMaxStreetNameLength = 30;
constexpr uint32_t kMaxStreetNameLength = 25;

std::vector<std::string> split(const std::string& source, char delimiter) {
std::vector<std::string> tokens;
Expand Down
5 changes: 5 additions & 0 deletions test/gurka/gurka.cc
Original file line number Diff line number Diff line change
Expand Up @@ -904,6 +904,8 @@ void expect_maneuver_begin_path_indexes(const valhalla::Api& result,
* @param result the result of a /route or /match request
* @param maneuver_index the specified maneuver index to inspect
* @param expected_text_instruction the expected text instruction
* @param expected_verbal_succinct_transition_instruction the expected verbal succinct transition
* instruction
* @param expected_verbal_transition_alert_instruction the expected verbal transition alert
* instruction
* @param expected_verbal_pre_transition_instruction the expected verbal pre-transition instruction
Expand All @@ -913,6 +915,7 @@ void expect_instructions_at_maneuver_index(
const valhalla::Api& result,
int maneuver_index,
const std::string& expected_text_instruction,
const std::string& expected_verbal_succinct_transition_instruction,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

probably not needed until - maybe only after focused gurka test are complete

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

probably not needed until - maybe only after focused gurka test are complete

or leave in if it is easier to just fix the tests after code is complete

const std::string& expected_verbal_transition_alert_instruction,
const std::string& expected_verbal_pre_transition_instruction,
const std::string& expected_verbal_post_transition_instruction) {
Expand All @@ -924,6 +927,8 @@ void expect_instructions_at_maneuver_index(
const auto& maneuver = result.directions().routes(0).legs(0).maneuver(maneuver_index);

EXPECT_EQ(maneuver.text_instruction(), expected_text_instruction);
EXPECT_EQ(maneuver.verbal_succinct_transition_instruction(),
expected_verbal_succinct_transition_instruction);
EXPECT_EQ(maneuver.verbal_transition_alert_instruction(),
expected_verbal_transition_alert_instruction);
EXPECT_EQ(maneuver.verbal_pre_transition_instruction(), expected_verbal_pre_transition_instruction);
Expand Down
3 changes: 3 additions & 0 deletions test/gurka/gurka.h
Original file line number Diff line number Diff line change
Expand Up @@ -246,6 +246,8 @@ void expect_maneuver_begin_path_indexes(const valhalla::Api& result,
* @param result the result of a /route or /match request
* @param maneuver_index the specified maneuver index to inspect
* @param expected_text_instruction the expected text instruction
* @param expected_verbal_succinct_transition_instruction the expected verbal succinct transition
* instruction
* @param expected_verbal_transition_alert_instruction the expected verbal transition alert
* instruction
* @param expected_verbal_pre_transition_instruction the expected verbal pre-transition instruction
Expand All @@ -255,6 +257,7 @@ void expect_instructions_at_maneuver_index(
const valhalla::Api& result,
int maneuver_index,
const std::string& expected_text_instruction,
const std::string& expected_verbal_succinct_transition_instruction,
const std::string& expected_verbal_transition_alert_instruction,
const std::string& expected_verbal_pre_transition_instruction,
const std::string& expected_verbal_post_transition_instruction);
Expand Down
2 changes: 2 additions & 0 deletions test/gurka/test_instructions_bear.cc
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ TEST_F(InstructionsBear, KeepRightBranchToward) {
// Verify the keep right toward instructions
gurka::assert::raw::expect_instructions_at_maneuver_index(result, maneuver_index,
"Bear right onto Larkin Street.",
"Bear right.",
"Bear right onto Larkin Street.",
"Bear right onto Larkin Street.",
"Continue for 5 kilometers.");
Expand All @@ -74,6 +75,7 @@ TEST_F(InstructionsBear, KeepLeftBranchToward) {
// Verify the keep left toward instructions
gurka::assert::raw::expect_instructions_at_maneuver_index(result, maneuver_index,
"Bear left onto Hayes Street.",
"Bear left.",
"Bear left onto Hayes Street.",
"Bear left onto Hayes Street.",
"Continue for 5 kilometers.");
Expand Down
4 changes: 3 additions & 1 deletion test/gurka/test_instructions_collapse_double_turn.cc
Original file line number Diff line number Diff line change
Expand Up @@ -64,14 +64,16 @@ TEST_F(InstructionsCollapseDoubleTurn, CollapseToOneLeft) {

// Verify the L turn instructions
gurka::assert::raw::expect_instructions_at_maneuver_index(
result, maneuver_index, "Turn left onto South River Road.", "Turn left onto South River Road.",
result, maneuver_index, "Turn left onto South River Road.", "Turn left.",
"Turn left onto South River Road.",
"Turn left onto South River Road. Then Turn left to take the ramp.", "Continue for 50 meters.");

maneuver_index = 2;

// Verify the L turn instructions
gurka::assert::raw::expect_instructions_at_maneuver_index(
result, maneuver_index, "Turn left to take the ramp.", "Turn left to take the ramp.",
"Turn left to take the ramp.",
"Turn left to take the ramp. Then, in 70 meters, You will arrive at your destination.",
"Continue for 70 meters.");
}
Expand Down
14 changes: 10 additions & 4 deletions test/gurka/test_instructions_collapse_merge.cc
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ TEST_F(InstructionsCollapseMerge, RightRampMerge) {
// Ramp right with collapsed merge
gurka::assert::raw::expect_instructions_at_maneuver_index(
result, maneuver_index, "Turn right to take the A 76 West ramp toward Pittsburgh.",
"Turn right to take the A 76 West ramp.",
"Turn right to take the ramp.", "Turn right to take the A 76 West ramp.",
"Turn right to take the A 76 West ramp toward Pittsburgh.", "Continue for 5 kilometers.");

// Collapsed merge info
Expand All @@ -105,6 +105,7 @@ TEST_F(InstructionsCollapseMerge, RightRampMerge) {
// gurka::assert::raw::
// expect_instructions_at_maneuver_index(result, maneuver_index,
// "Merge left onto A 76/Pennsylvania Turnpike.",
// "Merge left.",
// "Merge left onto A 76.",
// "Merge left onto A 76, Pennsylvania Turnpike.",
// "Continue for 3 kilometers.");
Expand All @@ -123,7 +124,7 @@ TEST_F(InstructionsCollapseMerge, LeftRampMerge) {
// Ramp left with collapsed merge
gurka::assert::raw::expect_instructions_at_maneuver_index(
result, maneuver_index, "Turn left to take the A 76 East ramp toward Philedelphia.",
"Turn left to take the A 76 East ramp.",
"Turn left to take the ramp.", "Turn left to take the A 76 East ramp.",
"Turn left to take the A 76 East ramp toward Philedelphia.", "Continue for 8 kilometers.");

// Collapsed merge info
Expand All @@ -133,6 +134,7 @@ TEST_F(InstructionsCollapseMerge, LeftRampMerge) {
// gurka::assert::raw::
// expect_instructions_at_maneuver_index(result, maneuver_index,
// "Merge right onto A 76/Pennsylvania Turnpike.",
// "Merge right.",
// "Merge right onto A 76.",
// "Merge right onto A 76, Pennsylvania Turnpike.",
// "Continue for 4 kilometers.");
Expand All @@ -153,7 +155,7 @@ TEST_F(InstructionsCollapseMerge, RightRampLeftForkMerge) {
gurka::assert::raw::expect_instructions_at_maneuver_index(
result, maneuver_index,
"Turn right to take the A 76 East/A 70 East ramp toward Philedelphia/Baltimore.",
"Turn right to take the A 76 East ramp.",
"Turn right to take the ramp.", "Turn right to take the A 76 East ramp.",
"Turn right to take the A 76 East, A 70 East ramp toward Philedelphia, Baltimore.",
"Continue for 2.5 kilometers.");

Expand All @@ -163,7 +165,7 @@ TEST_F(InstructionsCollapseMerge, RightRampLeftForkMerge) {
gurka::assert::raw::
expect_instructions_at_maneuver_index(result, maneuver_index,
"Keep left to take A 76/Pennsylvania Turnpike.",
"Keep left to take A 76.",
"Keep left at the fork.", "Keep left to take A 76.",
"Keep left to take A 76, Pennsylvania Turnpike.",
"Continue for 8 kilometers.");
// Collapsed merge info
Expand All @@ -173,6 +175,7 @@ TEST_F(InstructionsCollapseMerge, RightRampLeftForkMerge) {
// gurka::assert::raw::
// expect_instructions_at_maneuver_index(result, maneuver_index,
// "Merge left onto A 76/Pennsylvania Turnpike.",
// "Merge left.",
// "Merge left onto A 76.",
// "Merge left onto A 76, Pennsylvania Turnpike.",
// "Continue for 4 kilometers.");
Expand All @@ -193,6 +196,7 @@ TEST_F(InstructionsCollapseMerge, RightRampRightForkMerge) {
gurka::assert::raw::
expect_instructions_at_maneuver_index(result, maneuver_index,
"Turn right to take the A 70 East ramp toward Baltimore.",
"Turn right to take the ramp.",
"Turn right to take the A 70 East ramp.",
"Turn right to take the A 70 East ramp toward Baltimore.",
"Continue for 2.5 kilometers.");
Expand All @@ -203,6 +207,7 @@ TEST_F(InstructionsCollapseMerge, RightRampRightForkMerge) {
gurka::assert::raw::
expect_instructions_at_maneuver_index(result, maneuver_index,
"Keep right to take A 70 East toward Baltimore.",
"Keep right at the fork.",
"Keep right to take A 70 East.",
"Keep right to take A 70 East toward Baltimore.",
"Continue for 6 kilometers.");
Expand All @@ -213,6 +218,7 @@ TEST_F(InstructionsCollapseMerge, RightRampRightForkMerge) {
// // Merge left
// gurka::assert::raw::expect_instructions_at_maneuver_index(result, maneuver_index,
// "Merge left onto A 70.",
// "Merge left.",
// "Merge left onto A 70.",
// "Merge left onto A 70.",
// "Continue for 4 kilometers.");
Expand Down
3 changes: 2 additions & 1 deletion test/gurka/test_instructions_collapse_merge_toward.cc
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ TEST_F(InstructionsCollapseMergeToward, MergeLeftToward) {
gurka::assert::raw::
expect_instructions_at_maneuver_index(result, maneuver_index,
"Keep left to take A6 toward Harrisburg/Lancaster.",
"Keep left to take A6.",
"Keep left at the fork.", "Keep left to take A6.",
"Keep left to take A6 toward Harrisburg, Lancaster.",
"Continue for 6 kilometers.");

Expand All @@ -82,6 +82,7 @@ TEST_F(InstructionsCollapseMergeToward, MergeLeftToward) {
// gurka::assert::raw::
// expect_instructions_at_maneuver_index(result, maneuver_index,
// "Merge left toward A6/Harrisburg/Lancaster.",
// "Merge left.",
// "Merge left toward A6.",
// "Merge left toward A6, Harrisburg.",
// "Continue for 4 kilometers.");
Expand Down
2 changes: 2 additions & 0 deletions test/gurka/test_instructions_ferry_toward.cc
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ TEST_F(InstructionsFerryToward, TakeFerryTowardForward) {
// Verify the ferry toward instructions
gurka::assert::raw::expect_instructions_at_maneuver_index(result, maneuver_index,
"Take the ferry toward Cape May.",
"Take the Ferry.",
"Take the ferry toward Cape May.",
"Take the ferry toward Cape May.",
"Continue for 3 kilometers.");
Expand All @@ -82,6 +83,7 @@ TEST_F(InstructionsFerryToward, TakeFerryTowardBackward) {
// Verify the ferry toward instructions
gurka::assert::raw::expect_instructions_at_maneuver_index(result, maneuver_index,
"Take the ferry toward Lewes.",
"Take the Ferry.",
"Take the ferry toward Lewes.",
"Take the ferry toward Lewes.",
"Continue for 3 kilometers.");
Expand Down
Loading