{
- ctrl.validateInOrder()
+ $scope.$watch("freeOrder", () => {
+ ctrl.validateFreeOrder()
})
- /** Trigger error if the "in order" option is incompatible with the query */
- ctrl.validateInOrder = () => {
+ /** Trigger error if the "free order" option is incompatible with the query */
+ ctrl.validateFreeOrder = () => {
const cqpObjs = CQP.parse(ctrl.cqp)
if (!CQP.supportsInOrder(cqpObjs)) {
- // If query doesn't support free word order, and the "in order" checkbox has been unchecked,
+ // If query doesn't support free word order, and the "free order" checkbox is checked,
// then disable search, show explanation and let user resolve the conflict
- ctrl.orderError = !$scope.inOrder
- ctrl.inOrderEnabled = !$scope.inOrder
+ ctrl.orderError = $scope.freeOrder
+ ctrl.freeOrderEnabled = $scope.freeOrder
} else {
ctrl.orderError = false
- ctrl.inOrderEnabled = true
+ ctrl.freeOrderEnabled = true
}
}
diff --git a/app/scripts/components/simple_search.js b/app/scripts/components/simple_search.js
index 25c1fb74c..104a6ab58 100644
--- a/app/scripts/components/simple_search.js
+++ b/app/scripts/components/simple_search.js
@@ -22,12 +22,12 @@ export const simpleSearchComponent = {
>
- {{'in_order_chk' | loc:$root.lang}}
+ {{'free_order_chk' | loc:$root.lang}}
{{'and' | loc:$root.lang}}
{{'and_include' | loc:$root.lang}}
@@ -89,9 +89,10 @@ export const simpleSearchComponent = {
ctrl.onChange(event.value, false)
})
- ctrl.inOrder = $location.search().in_order == null
- /** Whether the "in order" option is applicable. */
- ctrl.inOrderEnabled = false
+ /** Whether tokens should be matched in arbitrary order. */
+ ctrl.freeOrder = $location.search().in_order != null
+ /** Whether the "free order" option is applicable. */
+ ctrl.freeOrderEnabled = false
ctrl.prefix = $location.search().prefix != null
ctrl.mid_comp = $location.search().mid_comp != null
ctrl.suffix = $location.search().suffix != null
@@ -104,7 +105,7 @@ export const simpleSearchComponent = {
// triggers watch on searches.activeSearch
ctrl.updateSearch = function () {
- $location.search("in_order", !ctrl.inOrder && ctrl.inOrderEnabled ? false : null)
+ $location.search("in_order", ctrl.freeOrder && ctrl.freeOrderEnabled ? false : null)
$location.search("prefix", ctrl.prefix ? true : null)
$location.search("mid_comp", ctrl.mid_comp ? true : null)
$location.search("suffix", ctrl.suffix ? true : null)
@@ -233,7 +234,7 @@ export const simpleSearchComponent = {
ctrl.lemgram = search.val
}
$rootScope.simpleCQP = CQP.expandOperators(ctrl.getCQP())
- ctrl.updateInOrderEnabled()
+ ctrl.updateFreeOrderEnabled()
ctrl.doSearch()
}
})
@@ -247,12 +248,12 @@ export const simpleSearchComponent = {
ctrl.currentText = null
}
- ctrl.updateInOrderEnabled()
+ ctrl.updateFreeOrderEnabled()
}
- ctrl.updateInOrderEnabled = () => {
+ ctrl.updateFreeOrderEnabled = () => {
const cqpObjs = CQP.parse(ctrl.getCQP() || "[]")
- ctrl.inOrderEnabled = CQP.supportsInOrder(cqpObjs)
+ ctrl.freeOrderEnabled = CQP.supportsInOrder(cqpObjs)
}
ctrl.doSearch = function () {
diff --git a/app/translations/locale-eng.json b/app/translations/locale-eng.json
index 8cf591b46..4ba0594eb 100644
--- a/app/translations/locale-eng.json
+++ b/app/translations/locale-eng.json
@@ -346,8 +346,8 @@
"add_filter_value": "Add",
"repeat_error": "Error: Not possible to repeat from 0 for all tokens.",
- "order_error": "Error: Disabling \"in order\" requires multiple tokens, no repetition, no boundaries and no wildcards.",
- "order_help": "Disabling the \"in order\" option is compatible with queries that have multiple tokens, no repetition, no boundaries and no wildcards.",
+ "order_error": "Error: The \"in free order\" option requires multiple tokens, no repetition, no boundaries and no wildcards.",
+ "order_help": "The \"in free order\" option is compatible with queries that have multiple tokens, no repetition, no boundaries and no wildcards.",
"choose_value": "Choose a value",
"login_needed_for_corpora": "Login needed for access to",
@@ -358,13 +358,13 @@
"go_to_start": "Go to start page",
"stats_warn": "Statistics is disabled",
- "stats_not_in_order_warn": "Statistics is currently not supported when \"in order\" is disabled.",
+ "stats_not_in_order_warn": "Statistics currently do not support the \"in free order\" search option.",
"read_in_strix": "Read this text in Strix",
"read_in_korp": "Read this text in Korp",
"add_token": "Add token",
- "in_order_chk": "in order",
+ "free_order_chk": "in free order",
"prefix_chk": "initial part",
"compound_middle": "medial part",
"suffix_chk": "final part",
diff --git a/app/translations/locale-swe.json b/app/translations/locale-swe.json
index 47efddf31..0f350c485 100644
--- a/app/translations/locale-swe.json
+++ b/app/translations/locale-swe.json
@@ -344,8 +344,8 @@
"add_filter_value": "Lägg till",
"repeat_error": "Fel: Det går inte att upprepa från 0 på alla token.",
- "order_error": "Fel: Det går bara att välja bort \"i följd\" om sökfrågan har flera tokens samt inga repetitioner, gränser eller tomma token.",
- "order_help": "Att välja bort \"i följd\" är kompatibelt med sökfrågor som har flera tokens samt inga repetitioner, gränser eller tomma token.",
+ "order_error": "Fel: Alternativet \"i fri följd\" fungerar bara om sökfrågan har flera tokens samt inga repetitioner, gränser eller tomma token.",
+ "order_help": "Alternativet \"i fri följd\" är kompatibelt med sökfrågor som har flera tokens samt inga repetitioner, gränser eller tomma token.",
"choose_value": "Välj ett värde",
"login_needed_for_corpora": "Inloggning behövs för åtkomst till",
@@ -356,13 +356,13 @@
"go_to_start": "Gå till startsidan",
"stats_warn": "Statistiken är avaktiverad",
- "stats_not_in_order_warn": "Statistiken stödjs för nuvarande inte när \"i följd\" är avaktiverad.",
+ "stats_not_in_order_warn": "Statistiken stödjer för närvarande inte sökalternativet \"i fri följd\".",
"read_in_strix": "Läs texten i Strix",
"read_in_korp": "Läs i Korp",
"add_token": "Lägg till token",
- "in_order_chk": "i följd",
+ "free_order_chk": "i fri följd",
"prefix_chk": "förled",
"compound_middle": "mellanled",
"suffix_chk": "efterled",
diff --git a/doc/user_manual_eng.md b/doc/user_manual_eng.md
index bd824379d..f3b561d76 100644
--- a/doc/user_manual_eng.md
+++ b/doc/user_manual_eng.md
@@ -55,9 +55,9 @@ the search button or hitting Enter.
Below the search field are a selection of check boxes, giving you a few options for your search.
-**In order**
+**In free order**
When searching for more than one word, the default search requires all words to occur in exactly the given order next to each
-other. By unchecking the *in order* box, the search will instead find all sentences containing the search words, but the
+other. By checking the *in free order* box, the search will instead find all sentences containing the search words, but the
order does not matter, and they do not need to be next to each other.
**Initial part and final part**
diff --git a/doc/user_manual_swe.md b/doc/user_manual_swe.md
index 87a5dcdba..91e2bf4f5 100644
--- a/doc/user_manual_swe.md
+++ b/doc/user_manual_swe.md
@@ -59,10 +59,10 @@ För att göra en lemgramsökning väljer man ett av dessa med piltangenterna sa
Under sökfältet finns ett antal kryssrutor med inställningsmöjligheter för ens sökning.
-**I följd**
+**I fri följd**
Vid sökning på fler än ett ord görs som standard en frassökning, vilket innebär att man enbart får träffar där sökorden
förekommer i exakt den ordning man angivit, och direkt efter varandra.
-Genom att kryssa ur rutan *i följd* söks det i stället efter meningar som innehåller samtliga
+Genom att kryssa i rutan *i fri följd* söks det i stället efter meningar som innehåller samtliga
sökord, i valfri ordning och inte nödvändigtvis intill varandra.
**Förled och efterled**