module("VOICE")

connections = {
	65792, 66048, 131840, 197632, 197888, 198144, 263936, 198656, 198912, 199168, 264960, 
	65792, 66048, 131840, 328704, 328960, 198144, 263936, 329728, 329984, 199168, 199424, 
	65792, 66048, 131840, 328704, 197888, 198144, 263936, 329728, 198912, 199168, 265216, 
	65792, 66048, 131840, 328704, 197888, 198144, 263936, 329728, 198912, 199168, 265216, 
	65792, 66048, 131840, 328704, 197888, 198144, 263936, 329728, 198912, 199168, 265216, 
	65792, 66048, 131840, 328704, 197888, 198144, 263936, 329728, 198912, 199168, 265216, 
	65792, 134400, 331264, 395008, 331520, 397312, 397568, 463360, 
	529152, 263936, 
	131840, 590848, 591104, 656896, 591872, 592128, 657920, 
	524800, 132096, 722688, 725504, 
	786689, 852226, 917763, 983300, 1053697, 1119234, 1184771, 1250308, 1053953, 1119490, 1185027, 1250564, 786945, 852482, 918019, 983556, 131840, 328704, 328960, 1312257, 1377794, 1443331, 1508868, 1312513, 1378050, 1443587, 1574660, 329728, 329984, 1313281, 1378818, 1444355, 1509892, 1313537, 1379074, 1444611, 1510148, 
	1638656, 1638912, 131840, 1704960, 1770757, 1770758, 1836295, 1771013, 1771014, 1836551, 1902341, 1902342, 263943, 1705984, 1771781, 1771782, 1837319, 1772037, 1772038, 1837575, 1903365, 1903366, 264967, 
	65792, 66048, 131840, 328704, 1967365, 1967366, 197895, 1967621, 1967622, 198151, 2033413, 2033414, 263943, 329728, 1968389, 1968390, 198919, 1968645, 1968646, 199175, 2034437, 2034438, 264967, 
	65792, 66048, 131840, 328704, 1967365, 1967366, 197895, 1967621, 1967622, 198151, 2033413, 2033414, 263943, 329728, 1968389, 1968390, 198919, 1968645, 1968646, 199175, 2034437, 2034438, 264967, 
	65792, 66048, 131840, 328704, 1967365, 1967366, 197895, 1967621, 1967622, 198151, 2033413, 2033414, 263943, 329728, 1968389, 1968390, 198919, 1968645, 1968646, 199175, 2034437, 2034438, 264967, 
	2102792, 
	2097672, 2102792, 
	}

rules = {
	{8, rangefun.common_then3_range_300, None, nil},
	{1, rangefun.common_then_range_100, None, nil},
	{16777217, rangefun.common_drive_range_1000, 254, nil},
	{16777224, rangefun.common_pre_range_500, 240, nil},
	{16777280, rangefun.common_app_range_200, 128, nil},
	{16777280, rangefun.common_app_range_50, 128, nil},
	{16777344, rangefun.common_now_range_0, 8388608, nil},
	{8, rangefun.common_pre_equal_800, 240, nil},
	{64, rangefun.common_app_equal_300, 128, nil},
	{64, rangefun.common_app_equal_100, 128, nil},
	{128, rangefun.common_now_equal_50, 8388608, nil},
	{128, rangefun.common_now_equal_1, 8388608, nil},
	{16777217, rangefun.common_drive_range_5000, 254, nil},
	{16777224, rangefun.common_pre_range_2000, 240, nil},
	{8, rangefun.common_pre_equal_3000, 240, nil},
	{128, rangefun.common_now_equal_1000, 8388608, nil},
	{128, rangefun.common_now_equal_300, 8388608, nil},
	{128, rangefun.common_now_equal_100, 8388608, nil},
	{1, rangefun.common_then_range_100000, None, nil},
	{4, rangefun.common_then2_range_100, None, nil},
	{2, rangefun.common_then1_range_100, None, nil},
	{16777344, rangefun.common_now_range_20, 8388608, nil},
}

conditions = {
	{condfun.X_e_3},
	{condfun.X_e_2},
	{condfun.X_e_1},
	{condfun.X_e_0},
	{condfun.exit_g_1},
	{condfun.exit_e_1},
	{condfun.exit_e_0},
	{condfun.exit_g_0},
}

id = {
	continue_left = 1,
	continue_right = 2,
	continue_sharp_left = 3,
	continue_sharp_right = 4,
	continue_uturn_left = 5,
	continue_uturn_right = 6,
	deformed_roundabout_exit = 7,
	exit_left = 8,
	exit_right = 9,
	ferry = 10,
	ferry_exit = 11,
	goal = 12,
	goal_left = 13,
	goal_right = 14,
	highway_enter = 15,
	highway_leave = 16,
	keep_left = 17,
	keep_left_b = 18,
	keep_left_hwy = 19,
	keep_left_shwy = 20,
	keep_right = 21,
	keep_right_b = 22,
	keep_right_hwy = 23,
	keep_right_shwy = 24,
	left = 25,
	priority = 26,
	priority_left = 27,
	priority_right = 28,
	ramp_left = 29,
	ramp_right = 30,
	right = 31,
	roundabout_back = 32,
	roundabout_exit = 33,
	roundabout_h = 34,
	roundabout_l = 35,
	roundabout_left = 36,
	roundabout_right = 37,
	roundabout_straight = 38,
	sharp_left = 39,
	sharp_right = 40,
	slight_left = 41,
	slight_right = 42,
	straight = 43,
	uturn = 44,
	uturn_left = 45,
	uturn_left_dual = 46,
	uturn_right = 47,
	uturn_right_dual = 48,
	via = 49,
	via_left = 50,
	via_right = 51,
}

parameters = {
	[id.continue_left] = {then_cnt = 1, CID = 23079440, L"turn_left-e", L"dist-turn_left-e", L"take_the_next_left-e", L"take_the_2nd_left-e", L"take_the_3rd_left-e", L"then_turn_left-e", L"then_take_the_next_left-e", L"then_take_the_2nd_left-e", L"then_take_the_3rd_left-e", L"then_turn_left-e-2", L"then_take_the_next_left-e-2", L"then_take_the_2nd_left-e-2", L"then_take_the_3rd_left-e-2"},
	[id.continue_right] = {then_cnt = 1, CID = 23079440, L"turn_right-e", L"dist-turn_right-e", L"take_the_next_right-e", L"take_the_2nd_right-e", L"take_the_3rd_right-e", L"then_turn_right-e", L"then_take_the_next_right-e", L"then_take_the_2nd_right-e", L"then_take_the_3rd_right-e", L"then_turn_right-e-2", L"then_take_the_next_right-e-2", L"then_take_the_2nd_right-e-2", L"then_take_the_3rd_right-e-2"},
	[id.continue_sharp_left] = {then_cnt = 1, CID = 23079440, L"turn_sharply_left-e", L"dist-turn_sharply_left-e", L"take_the_next_sharply_left-e", L"take_the_2nd_sharply_left-e", L"take_the_3rd_sharply_left-e", L"then_turn_sharply_left-e", L"then_take_the_next_sharply_left-e", L"then_take_the_2nd_sharply_left-e", L"then_take_the_3rd_sharply_left-e", L"then_turn_sharply_left-e-2", L"then_take_the_next_sharply_left-e-2", L"then_take_the_2nd_sharply_left-e-2", L"then_take_the_3rd_sharply_left-e-2"},
	[id.continue_sharp_right] = {then_cnt = 1, CID = 23079440, L"turn_sharply_right-e", L"dist-turn_sharply_right-e", L"take_the_next_sharply_right-e", L"take_the_2nd_sharply_right-e", L"take_the_3rd_sharply_right-e", L"then_turn_sharply_right-e", L"then_take_the_next_sharply_right-e", L"then_take_the_2nd_sharply_right-e", L"then_take_the_3rd_sharply_right-e", L"then_turn_sharply_right-e-2", L"then_take_the_next_sharply_right-e-2", L"then_take_the_2nd_sharply_right-e-2", L"then_take_the_3rd_sharply_right-e-2"},
	[id.continue_uturn_left] = {then_cnt = 1, CID = 23079440, L"turn_sharply_left-e", L"dist-turn_sharply_left-e", L"take_the_next_sharply_left-e", L"take_the_2nd_sharply_left-e", L"take_the_3rd_sharply_left-e", L"then_turn_sharply_left-e", L"then_take_the_next_sharply_left-e", L"then_take_the_2nd_sharply_left-e", L"then_take_the_3rd_sharply_left-e", L"then_turn_sharply_left-e-2", L"then_take_the_next_sharply_left-e-2", L"then_take_the_2nd_sharply_left-e-2", L"then_take_the_3rd_sharply_left-e-2"},
	[id.continue_uturn_right] = {then_cnt = 1, CID = 23079440, L"turn_sharply_right-e", L"dist-turn_sharply_right-e", L"take_the_next_sharply_right-e", L"take_the_2nd_sharply_right-e", L"take_the_3rd_sharply_right-e", L"then_turn_sharply_right-e", L"then_take_the_next_sharply_right-e", L"then_take_the_2nd_sharply_right-e", L"then_take_the_3rd_sharply_right-e", L"then_turn_sharply_right-e-2", L"then_take_the_next_sharply_right-e-2", L"then_take_the_2nd_sharply_right-e-2", L"then_take_the_3rd_sharply_right-e-2"},
	[id.deformed_roundabout_exit] = {then_cnt = 1, CID = 57147905, },
	[id.exit_left] = {then_cnt = 1, CID = 17567233, L"take_the_exit_on_the_left-e", L"dist-take_the_exit_on_the_left-e", L"then_take_the_exit_on_the_left-e"},
	[id.exit_right] = {then_cnt = 1, CID = 17567233, L"take_the_exit_on_the_right-e", L"dist-take_the_exit_on_the_right-e", L"then_take_the_exit_on_the_right-e"},
	[id.ferry] = {then_cnt = 1, CID = 22021633, L"take_the_ferry-e", L"then_take_the_ferry-e"},
	[id.ferry_exit] = {then_cnt = 1, CID = 20188672, L"leave_the_ferry-e"},
	[id.goal] = {then_cnt = 1, CID = 11801090, L"you_have_reached_your_destinaion-e", L"dist-you_will_arrive_at_your_destiantion-e", L"then_you_will_arrive_at_your_destination-e"},
	[id.goal_left] = {then_cnt = 1, CID = 14684674, L"you_have_reached_your_destinaion-e", L"dist-you_will_arrive_at_your_destiantion-e", L"then_you_will_arrive_at_your_destination-e"},
	[id.goal_right] = {then_cnt = 1, CID = 14684674, L"you_have_reached_your_destinaion-e", L"dist-you_will_arrive_at_your_destiantion-e", L"then_you_will_arrive_at_your_destination-e"},
	[id.highway_enter] = {then_cnt = 1, CID = 266754, L"enter_highway-e", L"dist-enter_highway-e", L"then_enter_highway-e"},
	[id.highway_leave] = {then_cnt = 1, CID = 17567233, L"leave_the_highway-e", L"dist-leave_the_highway-e", L"then_leave_the_highway-e"},
	[id.keep_left] = {then_cnt = 1, CID = 3150338, L"keep_left-e", L"dist-keep_left-e", L"then_keep_left-e"},
	[id.keep_left_b] = {then_cnt = 1, CID = 3150338, L"keep_left-e", L"dist-keep_left-e", L"then_keep_left-e"},
	[id.keep_left_hwy] = {then_cnt = 1, CID = 3150338, L"keep_left-e", L"dist-keep_left-e", L"then_keep_left-e"},
	[id.keep_left_shwy] = {then_cnt = 1, CID = 3150338, L"keep_left-e", L"dist-keep_left-e", L"then_keep_left-e"},
	[id.keep_right] = {then_cnt = 1, CID = 3150338, L"keep_right-e", L"dist-keep_right-e", L"then_keep_right-e"},
	[id.keep_right_b] = {then_cnt = 1, CID = 3150338, L"keep_right-e", L"dist-keep_right-e", L"then_keep_right-e"},
	[id.keep_right_hwy] = {then_cnt = 1, CID = 3150338, L"keep_right-e", L"dist-keep_right-e", L"then_keep_right-e"},
	[id.keep_right_shwy] = {then_cnt = 1, CID = 3150338, L"keep_right-e", L"dist-keep_right-e", L"then_keep_right-e"},
	[id.left] = {then_cnt = 1, CID = 23079440, L"turn_left-e", L"dist-turn_left-e", L"take_the_next_left-e", L"take_the_2nd_left-e", L"take_the_3rd_left-e", L"then_turn_left-e", L"then_take_the_next_left-e", L"then_take_the_2nd_left-e", L"then_take_the_3rd_left-e", L"then_turn_left-e-2", L"then_take_the_next_left-e-2", L"then_take_the_2nd_left-e-2", L"then_take_the_3rd_left-e-2"},
	[id.priority] = {then_cnt = 1, CID = 266754, L"follow_the_main_road-e", L"dist-follow_the_main_road-e", L"then_follow_the_main_road-e"},
	[id.priority_left] = {then_cnt = 1, CID = 3150338, L"keep_left-e", L"dist-keep_left-e", L"then_keep_left-e"},
	[id.priority_right] = {then_cnt = 1, CID = 3150338, L"keep_right-e", L"dist-keep_right-e", L"then_keep_right-e"},
	[id.ramp_left] = {then_cnt = 1, CID = 23079440, L"turn_left-e", L"dist-turn_left-e", L"take_the_next_left-e", L"take_the_2nd_left-e", L"take_the_3rd_left-e", L"then_turn_left-e", L"then_take_the_next_left-e", L"then_take_the_2nd_left-e", L"then_take_the_3rd_left-e", L"then_turn_left-e-2", L"then_take_the_next_left-e-2", L"then_take_the_2nd_left-e-2", L"then_take_the_3rd_left-e-2"},
	[id.ramp_right] = {then_cnt = 1, CID = 23079440, L"turn_right-e", L"dist-turn_right-e", L"take_the_next_right-e", L"take_the_2nd_right-e", L"take_the_3rd_right-e", L"then_turn_right-e", L"then_take_the_next_right-e", L"then_take_the_2nd_right-e", L"then_take_the_3rd_right-e", L"then_turn_right-e-2", L"then_take_the_next_right-e-2", L"then_take_the_2nd_right-e-2", L"then_take_the_3rd_right-e-2"},
	[id.right] = {then_cnt = 1, CID = 23079440, L"turn_right-e", L"dist-turn_right-e", L"take_the_next_right-e", L"take_the_2nd_right-e", L"take_the_3rd_right-e", L"then_turn_right-e", L"then_take_the_next_right-e", L"then_take_the_2nd_right-e", L"then_take_the_3rd_right-e", L"then_turn_right-e-2", L"then_take_the_next_right-e-2", L"then_take_the_2nd_right-e-2", L"then_take_the_3rd_right-e-2"},
	[id.roundabout_back] = {then_cnt = 1, CID = 44837378, L"turn_back_in_the_roundabout-e", L"dist-turn_back_in_the_roundabout-e", L"then_turn_back_in_the_roundabout-e"},
	[id.roundabout_exit] = {then_cnt = 1, CID = 56885760, },
	[id.roundabout_h] = {then_cnt = 1, CID = 32778754, L"enter_the_roundabout-e", L"enter_the_roundabout_and", L"dist-enter_the_roundabout-e", L"dist-enter_the_roundabout_and", L"then_enter_the_roundabout-e"},
	[id.roundabout_l] = {then_cnt = 1, CID = 32778754, L"enter_the_roundabout-e", L"enter_the_roundabout_and", L"dist-enter_the_roundabout-e", L"dist-enter_the_roundabout_and", L"then_enter_the_roundabout-e"},
	[id.roundabout_left] = {then_cnt = 1, CID = 38808066, L"turn_left_in_the_roundabout-e", L"dist-turn_left_in_the_roundabout-e", L"then_turn_left_in_the_roundabout-e"},
	[id.roundabout_right] = {then_cnt = 1, CID = 38808066, L"turn_right_in_the_roundabout-e", L"dist-turn_right_in_the_roundabout-e", L"then_turn_right_in_the_roundabout-e"},
	[id.roundabout_straight] = {then_cnt = 1, CID = 50866690, L"cross_the_roundabout-e", L"dist-cross_the_roundabout-e", L"then_cross_the_roundabout-e"},
	[id.sharp_left] = {then_cnt = 1, CID = 23079440, L"turn_sharply_left-e", L"dist-turn_sharply_left-e", L"take_the_next_sharply_left-e", L"take_the_2nd_sharply_left-e", L"take_the_3rd_sharply_left-e", L"then_turn_sharply_left-e", L"then_take_the_next_sharply_left-e", L"then_take_the_2nd_sharply_left-e", L"then_take_the_3rd_sharply_left-e", L"then_turn_sharply_left-e-2", L"then_take_the_next_sharply_left-e-2", L"then_take_the_2nd_sharply_left-e-2", L"then_take_the_3rd_sharply_left-e-2"},
	[id.sharp_right] = {then_cnt = 1, CID = 23079440, L"turn_sharply_right-e", L"dist-turn_sharply_right-e", L"take_the_next_sharply_right-e", L"take_the_2nd_sharply_right-e", L"take_the_3rd_sharply_right-e", L"then_turn_sharply_right-e", L"then_take_the_next_sharply_right-e", L"then_take_the_2nd_sharply_right-e", L"then_take_the_3rd_sharply_right-e", L"then_turn_sharply_right-e-2", L"then_take_the_next_sharply_right-e-2", L"then_take_the_2nd_sharply_right-e-2", L"then_take_the_3rd_sharply_right-e-2"},
	[id.slight_left] = {then_cnt = 1, CID = 3150338, L"bear_left-e", L"dist-bear_left-e", L"then_bear_left-e"},
	[id.slight_right] = {then_cnt = 1, CID = 3150338, L"bear_right-e", L"dist-bear_right-e", L"then_bear_right-e"},
	[id.straight] = {then_cnt = 1, CID = 266754, L"continue_straight-e", L"dist-continue_straight-e", L"then_continue_straight-e"},
	[id.uturn] = {then_cnt = 1, CID = 19661313, L"turn_back_where_possible-e", L"then_turn_back_where_possible-e"},
	[id.uturn_left] = {then_cnt = 1, CID = 23079440, L"turn_sharply_left-e", L"dist-turn_sharply_left-e", L"take_the_next_sharply_left-e", L"take_the_2nd_sharply_left-e", L"take_the_3rd_sharply_left-e", L"then_turn_sharply_left-e", L"then_take_the_next_sharply_left-e", L"then_take_the_2nd_sharply_left-e", L"then_take_the_3rd_sharply_left-e", L"then_turn_sharply_left-e-2", L"then_take_the_next_sharply_left-e-2", L"then_take_the_2nd_sharply_left-e-2", L"then_take_the_3rd_sharply_left-e-2"},
	[id.uturn_left_dual] = {then_cnt = 1, CID = 266754, L"make_a_uturn-e", L"dist-make_a_uturn-e", L"then_make_a_uturn-e"},
	[id.uturn_right] = {then_cnt = 1, CID = 23079440, L"turn_sharply_right-e", L"dist-turn_sharply_right-e", L"take_the_next_sharply_right-e", L"take_the_2nd_sharply_right-e", L"take_the_3rd_sharply_right-e", L"then_turn_sharply_right-e", L"then_take_the_next_sharply_right-e", L"then_take_the_2nd_sharply_right-e", L"then_take_the_3rd_sharply_right-e", L"then_turn_sharply_right-e-2", L"then_take_the_next_sharply_right-e-2", L"then_take_the_2nd_sharply_right-e-2", L"then_take_the_3rd_sharply_right-e-2"},
	[id.uturn_right_dual] = {then_cnt = 1, CID = 266754, L"make_a_uturn-e", L"dist-make_a_uturn-e", L"then_make_a_uturn-e"},
	[id.via] = {then_cnt = 1, CID = 6033922, L"you_have_reached_a_viapoint-e", L"dist-you_will_arrive_at_viapoint-e", L"then_you_will_arrive_at_viapoint-e"},
	[id.via_left] = {then_cnt = 1, CID = 8917506, L"you_have_reached_a_viapoint-e", L"dist-you_will_arrive_at_viapoint-e", L"then_you_will_arrive_at_viapoint-e"},
	[id.via_right] = {then_cnt = 1, CID = 8917506, L"you_have_reached_a_viapoint-e", L"dist-you_will_arrive_at_viapoint-e", L"then_you_will_arrive_at_viapoint-e"},
}

patterns = {
	L"%3",
	L"follow_the_road_ahead-e",
	L"%dist %2 %then",
	L"%1 %then",
	L"%dist %2",
	L"%dist %2 %then3",
	L"%1 %then3",
	L"%2",
	L"%dist %1",
	L"%dist %1 %then",
	L"%1",
	L"%9",
	L"%8",
	L"%7",
	L"%6",
	L"%13",
	L"%12",
	L"%11",
	L"%10",
	L"%5 %then1",
	L"%4 %then1",
	L"%3 %then1",
	L"%dist %2 %then1",
	L"%1 %then1",
	L"%5",
	L"%dist %3",
	L"%dist %4 %exitb %then",
	L"%dist %3 %then",
	L"%2 %exit %then",
	L"%dist %2 %exitc %then",
	L"%1 %exitc %then",
	L"%exitc",
}

poi = {
}

sentence_types = {
	app = 64,
	app1 = 32,
	app2 = 16,
	drive = 1,
	more = 16777216,
	now = 128,
	pre = 8,
	pre1 = 4,
	pre2 = 2,
	stop = 8388608,
}

then_types = {
	["then"] = 1,
	["then1"] = 3,
	["then2"] = 5,
	["then3"] = 9,
	["then4"] = 17,
	["then5"] = 33,
}

