From 23698718dde752042effcce94418bdb11dfb78c2 Mon Sep 17 00:00:00 2001 From: Taka Date: Tue, 20 Apr 2021 14:08:45 +1000 Subject: [PATCH] Added more search synonyms. --- asl_rulebook2/webapp/config/search-aliases.json | 4 ++-- .../webapp/config/search-replacements.json | 2 +- asl_rulebook2/webapp/config/search-synonyms.json | 15 +++++++++++---- .../webapp/tests/test_linkify_ruleids.py | 4 ++-- 4 files changed, 16 insertions(+), 9 deletions(-) diff --git a/asl_rulebook2/webapp/config/search-aliases.json b/asl_rulebook2/webapp/config/search-aliases.json index 05dc688..650336a 100644 --- a/asl_rulebook2/webapp/config/search-aliases.json +++ b/asl_rulebook2/webapp/config/search-aliases.json @@ -3,13 +3,13 @@ "_comment_": "This file defines search aliases.", "_comment_": "Keys that appear in a query string will match itself or any of its associated values.", "_comment_": " e.g. searching for 'entrenchments' will actually search for 'entrenchments OR foxhole OR trench OR ditch'", -"_comment_": "These differ from search synonyms in that only the key word will trigger the replacement, not any word from the set.", +"_comment_": "These differ from search synonyms in that *only* the key word will trigger the replacement, not any word from the set.", "_comment_": "A user-defined version of this file in the data directory will also be loaded.", "latw": [ "atmm", "atr", "baz", "mol-p", "mol-projector", "piat", "pf", "pfk", "psk" ], -"fortification/foritifcations": [ +"fortification/fortifications": [ "cave", "a-t ditch", "foxhole", "sangar", "trench", "bunker", "minefield", "mines", "booby trap", "panji", "pillbox", "roadblock", "tetrahedron", "wire" ], "entrenchment/entrenchments": [ diff --git a/asl_rulebook2/webapp/config/search-replacements.json b/asl_rulebook2/webapp/config/search-replacements.json index 8faa469..35c4eb4 100644 --- a/asl_rulebook2/webapp/config/search-replacements.json +++ b/asl_rulebook2/webapp/config/search-replacements.json @@ -1,7 +1,7 @@ { "_comment_": "This file defines search replacements.", -"_comment_": "Keys that appear in a query string will be replaced by the value.", +"_comment_": "Keys that appear in a query string will be *replaced* by the value.", "_comment_": " e.g. searching for '1/2 MF' will actually search for '½ MF'", "_comment_": "A user-defined version of this file in the data directory will also be loaded.", diff --git a/asl_rulebook2/webapp/config/search-synonyms.json b/asl_rulebook2/webapp/config/search-synonyms.json index 0ad12b2..ed19742 100644 --- a/asl_rulebook2/webapp/config/search-synonyms.json +++ b/asl_rulebook2/webapp/config/search-synonyms.json @@ -3,7 +3,7 @@ "This file defines search synonyms.", "If a word appears in a query string, it will match any of the words in its set.", " e.g. searching for 'finn gun' will actually search for '(finn OR finnish) AND gun'", -"These differ from search aliases in that any word from a set will trigger the replacement.", +"These differ from search aliases in that *any* word from a set will trigger the replacement.", "A user-defined version of this file in the data directory will also be loaded.", [ "u.s.", "america", "american" ], @@ -19,8 +19,8 @@ [ "ft", "flamethrower", "flame-thrower" ], [ "baz", "bazooka" ], [ "pf", "panzerfaust" ], -[ "psk", "panzershreck" ], -[ "wp", "white phosphorous" ], +[ "psk", "panzerschreck" ], +[ "wp", "white phosphorus" ], [ "mol", "molotov cocktail" ], [ "ovr", "overrun" ], [ "cc", "close combat" ], @@ -31,9 +31,17 @@ [ "firelane", "fire-lane", "fire lane" ], [ "firegroup", "fire-group", "fire group" ], [ "lc", "landing craft" ], +[ "dp", "damage points" ], [ "ht", "halftrack", "half-track" ], [ "wa", "wall advantage" ], [ "hob", "heat of battle" ], +[ "ch", "critical hit" ], +[ "ti", "temporarily immobilized" ], +[ "ammo", "ammunition" ], +[ "malf", "malfunction" ], +[ "resid", "residual", "rfp" ], +[ "voluntary", "voluntarily" ], +[ "hth", "hand-to-hand" ], [ "cg", "campaign game" ], [ "pbm", "pbem" ], @@ -44,7 +52,6 @@ [ "brt", "br:t", "blood reef tarawa" ], [ "pb", "pegasus bridge" ], -[ "ammo", "ammunition" ], [ "armor", "armour" ], [ "color", "colour" ] diff --git a/asl_rulebook2/webapp/tests/test_linkify_ruleids.py b/asl_rulebook2/webapp/tests/test_linkify_ruleids.py index 5d1e6b0..58daf89 100644 --- a/asl_rulebook2/webapp/tests/test_linkify_ruleids.py +++ b/asl_rulebook2/webapp/tests/test_linkify_ruleids.py @@ -53,8 +53,8 @@ def test_qa( webdriver, webapp ): # test ruleid's in a Q+A entry's search result results = _do_search( "wp", True ) - assert len(results) == 3 - sr_elem = find_children( "#search-results .sr" )[ 1 ] + assert len(results) == 5 + sr_elem = find_children( "#search-results .sr" )[ 3 ] _check_ruleid( find_child(".caption",sr_elem), ("asl-rulebook!","A24.31") ) _dismiss_rule_info_popup() _check_ruleid( find_child(".question",sr_elem), ("asl-rulebook!","A24.3") )