aa765bbb48
- contracts/schema/migrations/0002_categories_v2.sql: server migration 0002 rebuilds categories with the 14-key default_key CHECK, inserts housing, insurance, children and fees with server_versions taken from the global sequence, sets schema_version 2. server-v1.sql unchanged. - contracts/category-keywords.csv: the keyword table of the suggestion (148 entries, from docs/ux). - contracts/test-vectors/suggest_category.json: 65 Kotlin-only cases of CS-4 to CS-6. - contracts/examples/E-1-health: schema_version 2. - tools/contracts-check.py: reference suggestCategory, keyword-table checks, 0002 load checks on a fresh and an in-use database, plain icon/color check, new icon and colour tokens. - android/domain: suggestCategory (CS-4 to CS-6, code points, platform NFC and categories through UnicodeText), vector runner for suggest_category, eight vector files. - server/crates/kvitt-domain/tests/vectors.rs: suggest_category is Kotlin-only. The OpenAPI DefaultCategoryKey extension and the two new category examples are held back until the server's wire types know the new keys (M12b). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01TQd3pEP9UeN2uifbHknQ7B
7514 lines
207 KiB
JSON
7514 lines
207 KiB
JSON
{
|
|
"format": 1,
|
|
"function": "suggest_category",
|
|
"cases": [
|
|
{
|
|
"name": "empty description gives the fallback, even with history and keywords",
|
|
"input": {
|
|
"description": "",
|
|
"history": [
|
|
{
|
|
"description": "Ica",
|
|
"category_id": "01920000-0000-7000-8000-000000000001",
|
|
"expense_date": "2026-10-01",
|
|
"created_at": "2026-10-01T12:00:00.000Z"
|
|
}
|
|
],
|
|
"keywords": [
|
|
{
|
|
"keyword": "ica",
|
|
"match": "token",
|
|
"default_key": "groceries"
|
|
}
|
|
],
|
|
"active_categories": [
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000001",
|
|
"default_key": "groceries"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000002",
|
|
"default_key": "restaurants"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000011",
|
|
"default_key": "housing"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000003",
|
|
"default_key": "home"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000004",
|
|
"default_key": "utilities"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000012",
|
|
"default_key": "insurance"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000005",
|
|
"default_key": "transport"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000006",
|
|
"default_key": "travel"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000007",
|
|
"default_key": "entertainment"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000008",
|
|
"default_key": "health"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000013",
|
|
"default_key": "children"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000009",
|
|
"default_key": "shopping"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000014",
|
|
"default_key": "fees"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-00000000000a",
|
|
"default_key": "other"
|
|
}
|
|
],
|
|
"fallback": "01920000-0000-7000-8000-00000000000a"
|
|
},
|
|
"expected": {
|
|
"ok": "01920000-0000-7000-8000-00000000000a"
|
|
}
|
|
},
|
|
{
|
|
"name": "empty description with a null fallback gives null",
|
|
"input": {
|
|
"description": "",
|
|
"history": [
|
|
{
|
|
"description": "Ica",
|
|
"category_id": "01920000-0000-7000-8000-000000000001",
|
|
"expense_date": "2026-10-01",
|
|
"created_at": "2026-10-01T12:00:00.000Z"
|
|
}
|
|
],
|
|
"keywords": [
|
|
{
|
|
"keyword": "ica",
|
|
"match": "token",
|
|
"default_key": "groceries"
|
|
}
|
|
],
|
|
"active_categories": [
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000001",
|
|
"default_key": "groceries"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000002",
|
|
"default_key": "restaurants"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000011",
|
|
"default_key": "housing"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000003",
|
|
"default_key": "home"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000004",
|
|
"default_key": "utilities"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000012",
|
|
"default_key": "insurance"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000005",
|
|
"default_key": "transport"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000006",
|
|
"default_key": "travel"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000007",
|
|
"default_key": "entertainment"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000008",
|
|
"default_key": "health"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000013",
|
|
"default_key": "children"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000009",
|
|
"default_key": "shopping"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000014",
|
|
"default_key": "fees"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-00000000000a",
|
|
"default_key": "other"
|
|
}
|
|
],
|
|
"fallback": null
|
|
},
|
|
"expected": {
|
|
"ok": null
|
|
}
|
|
},
|
|
{
|
|
"name": "whitespace-only description is empty",
|
|
"input": {
|
|
"description": " \t \n",
|
|
"history": [
|
|
{
|
|
"description": "Ica",
|
|
"category_id": "01920000-0000-7000-8000-000000000001",
|
|
"expense_date": "2026-10-01",
|
|
"created_at": "2026-10-01T12:00:00.000Z"
|
|
}
|
|
],
|
|
"keywords": [
|
|
{
|
|
"keyword": "ica",
|
|
"match": "token",
|
|
"default_key": "groceries"
|
|
}
|
|
],
|
|
"active_categories": [
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000001",
|
|
"default_key": "groceries"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000002",
|
|
"default_key": "restaurants"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000011",
|
|
"default_key": "housing"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000003",
|
|
"default_key": "home"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000004",
|
|
"default_key": "utilities"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000012",
|
|
"default_key": "insurance"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000005",
|
|
"default_key": "transport"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000006",
|
|
"default_key": "travel"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000007",
|
|
"default_key": "entertainment"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000008",
|
|
"default_key": "health"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000013",
|
|
"default_key": "children"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000009",
|
|
"default_key": "shopping"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000014",
|
|
"default_key": "fees"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-00000000000a",
|
|
"default_key": "other"
|
|
}
|
|
],
|
|
"fallback": "01920000-0000-7000-8000-000000000002"
|
|
},
|
|
"expected": {
|
|
"ok": "01920000-0000-7000-8000-000000000002"
|
|
}
|
|
},
|
|
{
|
|
"name": "punctuation-only description is empty and does not match a history row that also normalises to empty",
|
|
"input": {
|
|
"description": "!!!",
|
|
"history": [
|
|
{
|
|
"description": "...",
|
|
"category_id": "01920000-0000-7000-8000-000000000003",
|
|
"expense_date": "2026-10-01",
|
|
"created_at": "2026-10-01T12:00:00.000Z"
|
|
}
|
|
],
|
|
"keywords": [],
|
|
"active_categories": [
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000001",
|
|
"default_key": "groceries"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000002",
|
|
"default_key": "restaurants"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000011",
|
|
"default_key": "housing"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000003",
|
|
"default_key": "home"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000004",
|
|
"default_key": "utilities"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000012",
|
|
"default_key": "insurance"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000005",
|
|
"default_key": "transport"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000006",
|
|
"default_key": "travel"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000007",
|
|
"default_key": "entertainment"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000008",
|
|
"default_key": "health"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000013",
|
|
"default_key": "children"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000009",
|
|
"default_key": "shopping"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000014",
|
|
"default_key": "fees"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-00000000000a",
|
|
"default_key": "other"
|
|
}
|
|
],
|
|
"fallback": "01920000-0000-7000-8000-00000000000a"
|
|
},
|
|
"expected": {
|
|
"ok": "01920000-0000-7000-8000-00000000000a"
|
|
}
|
|
},
|
|
{
|
|
"name": "history exact: the category used most often wins over the most recent",
|
|
"input": {
|
|
"description": "Ica Maxi",
|
|
"history": [
|
|
{
|
|
"description": "ICA Maxi",
|
|
"category_id": "01920000-0000-7000-8000-000000000001",
|
|
"expense_date": "2026-09-01",
|
|
"created_at": "2026-09-01T12:00:00.000Z"
|
|
},
|
|
{
|
|
"description": "Ica Maxi",
|
|
"category_id": "01920000-0000-7000-8000-000000000001",
|
|
"expense_date": "2026-09-08",
|
|
"created_at": "2026-09-08T12:00:00.000Z"
|
|
},
|
|
{
|
|
"description": "Ica Maxi",
|
|
"category_id": "01920000-0000-7000-8000-000000000003",
|
|
"expense_date": "2026-10-01",
|
|
"created_at": "2026-10-01T12:00:00.000Z"
|
|
}
|
|
],
|
|
"keywords": [
|
|
{
|
|
"keyword": "ica",
|
|
"match": "token",
|
|
"default_key": "groceries"
|
|
}
|
|
],
|
|
"active_categories": [
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000001",
|
|
"default_key": "groceries"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000002",
|
|
"default_key": "restaurants"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000011",
|
|
"default_key": "housing"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000003",
|
|
"default_key": "home"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000004",
|
|
"default_key": "utilities"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000012",
|
|
"default_key": "insurance"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000005",
|
|
"default_key": "transport"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000006",
|
|
"default_key": "travel"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000007",
|
|
"default_key": "entertainment"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000008",
|
|
"default_key": "health"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000013",
|
|
"default_key": "children"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000009",
|
|
"default_key": "shopping"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000014",
|
|
"default_key": "fees"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-00000000000a",
|
|
"default_key": "other"
|
|
}
|
|
],
|
|
"fallback": "01920000-0000-7000-8000-00000000000a"
|
|
},
|
|
"expected": {
|
|
"ok": "01920000-0000-7000-8000-000000000001"
|
|
}
|
|
},
|
|
{
|
|
"name": "history exact: a tie on count goes to the most recent expense_date",
|
|
"input": {
|
|
"description": "Ica Maxi",
|
|
"history": [
|
|
{
|
|
"description": "Ica Maxi",
|
|
"category_id": "01920000-0000-7000-8000-000000000001",
|
|
"expense_date": "2026-09-01",
|
|
"created_at": "2026-09-01T12:00:00.000Z"
|
|
},
|
|
{
|
|
"description": "Ica Maxi",
|
|
"category_id": "01920000-0000-7000-8000-000000000003",
|
|
"expense_date": "2026-10-01",
|
|
"created_at": "2026-10-01T12:00:00.000Z"
|
|
}
|
|
],
|
|
"keywords": [
|
|
{
|
|
"keyword": "ica",
|
|
"match": "token",
|
|
"default_key": "groceries"
|
|
}
|
|
],
|
|
"active_categories": [
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000001",
|
|
"default_key": "groceries"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000002",
|
|
"default_key": "restaurants"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000011",
|
|
"default_key": "housing"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000003",
|
|
"default_key": "home"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000004",
|
|
"default_key": "utilities"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000012",
|
|
"default_key": "insurance"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000005",
|
|
"default_key": "transport"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000006",
|
|
"default_key": "travel"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000007",
|
|
"default_key": "entertainment"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000008",
|
|
"default_key": "health"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000013",
|
|
"default_key": "children"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000009",
|
|
"default_key": "shopping"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000014",
|
|
"default_key": "fees"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-00000000000a",
|
|
"default_key": "other"
|
|
}
|
|
],
|
|
"fallback": "01920000-0000-7000-8000-00000000000a"
|
|
},
|
|
"expected": {
|
|
"ok": "01920000-0000-7000-8000-000000000003"
|
|
}
|
|
},
|
|
{
|
|
"name": "history exact: a tie compares the latest expense of each tied category",
|
|
"input": {
|
|
"description": "Ica Maxi",
|
|
"history": [
|
|
{
|
|
"description": "Ica Maxi",
|
|
"category_id": "01920000-0000-7000-8000-000000000001",
|
|
"expense_date": "2026-01-10",
|
|
"created_at": "2026-01-10T12:00:00.000Z"
|
|
},
|
|
{
|
|
"description": "Ica Maxi",
|
|
"category_id": "01920000-0000-7000-8000-000000000003",
|
|
"expense_date": "2026-02-10",
|
|
"created_at": "2026-02-10T12:00:00.000Z"
|
|
},
|
|
{
|
|
"description": "Ica Maxi",
|
|
"category_id": "01920000-0000-7000-8000-000000000003",
|
|
"expense_date": "2026-02-20",
|
|
"created_at": "2026-02-20T12:00:00.000Z"
|
|
},
|
|
{
|
|
"description": "Ica Maxi",
|
|
"category_id": "01920000-0000-7000-8000-000000000001",
|
|
"expense_date": "2026-03-10",
|
|
"created_at": "2026-03-10T12:00:00.000Z"
|
|
}
|
|
],
|
|
"keywords": [
|
|
{
|
|
"keyword": "ica",
|
|
"match": "token",
|
|
"default_key": "groceries"
|
|
}
|
|
],
|
|
"active_categories": [
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000001",
|
|
"default_key": "groceries"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000002",
|
|
"default_key": "restaurants"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000011",
|
|
"default_key": "housing"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000003",
|
|
"default_key": "home"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000004",
|
|
"default_key": "utilities"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000012",
|
|
"default_key": "insurance"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000005",
|
|
"default_key": "transport"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000006",
|
|
"default_key": "travel"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000007",
|
|
"default_key": "entertainment"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000008",
|
|
"default_key": "health"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000013",
|
|
"default_key": "children"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000009",
|
|
"default_key": "shopping"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000014",
|
|
"default_key": "fees"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-00000000000a",
|
|
"default_key": "other"
|
|
}
|
|
],
|
|
"fallback": "01920000-0000-7000-8000-00000000000a"
|
|
},
|
|
"expected": {
|
|
"ok": "01920000-0000-7000-8000-000000000001"
|
|
}
|
|
},
|
|
{
|
|
"name": "history exact: on the same expense_date the later created_at wins",
|
|
"input": {
|
|
"description": "Ica Maxi",
|
|
"history": [
|
|
{
|
|
"description": "Ica Maxi",
|
|
"category_id": "01920000-0000-7000-8000-000000000001",
|
|
"expense_date": "2026-10-01",
|
|
"created_at": "2026-10-01T08:00:00.000Z"
|
|
},
|
|
{
|
|
"description": "Ica Maxi",
|
|
"category_id": "01920000-0000-7000-8000-000000000003",
|
|
"expense_date": "2026-10-01",
|
|
"created_at": "2026-10-01T09:00:00.000Z"
|
|
}
|
|
],
|
|
"keywords": [],
|
|
"active_categories": [
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000001",
|
|
"default_key": "groceries"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000002",
|
|
"default_key": "restaurants"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000011",
|
|
"default_key": "housing"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000003",
|
|
"default_key": "home"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000004",
|
|
"default_key": "utilities"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000012",
|
|
"default_key": "insurance"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000005",
|
|
"default_key": "transport"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000006",
|
|
"default_key": "travel"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000007",
|
|
"default_key": "entertainment"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000008",
|
|
"default_key": "health"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000013",
|
|
"default_key": "children"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000009",
|
|
"default_key": "shopping"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000014",
|
|
"default_key": "fees"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-00000000000a",
|
|
"default_key": "other"
|
|
}
|
|
],
|
|
"fallback": "01920000-0000-7000-8000-00000000000a"
|
|
},
|
|
"expected": {
|
|
"ok": "01920000-0000-7000-8000-000000000003"
|
|
}
|
|
},
|
|
{
|
|
"name": "history exact: expense_date decides before created_at (a back-dated expense entered later is older)",
|
|
"input": {
|
|
"description": "Ica Maxi",
|
|
"history": [
|
|
{
|
|
"description": "Ica Maxi",
|
|
"category_id": "01920000-0000-7000-8000-000000000001",
|
|
"expense_date": "2026-10-02",
|
|
"created_at": "2026-10-02T08:00:00.000Z"
|
|
},
|
|
{
|
|
"description": "Ica Maxi",
|
|
"category_id": "01920000-0000-7000-8000-000000000003",
|
|
"expense_date": "2026-10-01",
|
|
"created_at": "2026-10-05T08:00:00.000Z"
|
|
}
|
|
],
|
|
"keywords": [],
|
|
"active_categories": [
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000001",
|
|
"default_key": "groceries"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000002",
|
|
"default_key": "restaurants"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000011",
|
|
"default_key": "housing"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000003",
|
|
"default_key": "home"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000004",
|
|
"default_key": "utilities"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000012",
|
|
"default_key": "insurance"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000005",
|
|
"default_key": "transport"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000006",
|
|
"default_key": "travel"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000007",
|
|
"default_key": "entertainment"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000008",
|
|
"default_key": "health"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000013",
|
|
"default_key": "children"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000009",
|
|
"default_key": "shopping"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000014",
|
|
"default_key": "fees"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-00000000000a",
|
|
"default_key": "other"
|
|
}
|
|
],
|
|
"fallback": "01920000-0000-7000-8000-00000000000a"
|
|
},
|
|
"expected": {
|
|
"ok": "01920000-0000-7000-8000-000000000001"
|
|
}
|
|
},
|
|
{
|
|
"name": "history exact: descriptions are compared after normalisation",
|
|
"input": {
|
|
"description": "ica maxi",
|
|
"history": [
|
|
{
|
|
"description": "ICA: Maxi!",
|
|
"category_id": "01920000-0000-7000-8000-000000000003",
|
|
"expense_date": "2026-10-01",
|
|
"created_at": "2026-10-01T12:00:00.000Z"
|
|
}
|
|
],
|
|
"keywords": [
|
|
{
|
|
"keyword": "ica",
|
|
"match": "token",
|
|
"default_key": "groceries"
|
|
}
|
|
],
|
|
"active_categories": [
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000001",
|
|
"default_key": "groceries"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000002",
|
|
"default_key": "restaurants"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000011",
|
|
"default_key": "housing"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000003",
|
|
"default_key": "home"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000004",
|
|
"default_key": "utilities"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000012",
|
|
"default_key": "insurance"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000005",
|
|
"default_key": "transport"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000006",
|
|
"default_key": "travel"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000007",
|
|
"default_key": "entertainment"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000008",
|
|
"default_key": "health"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000013",
|
|
"default_key": "children"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000009",
|
|
"default_key": "shopping"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000014",
|
|
"default_key": "fees"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-00000000000a",
|
|
"default_key": "other"
|
|
}
|
|
],
|
|
"fallback": "01920000-0000-7000-8000-00000000000a"
|
|
},
|
|
"expected": {
|
|
"ok": "01920000-0000-7000-8000-000000000003"
|
|
}
|
|
},
|
|
{
|
|
"name": "history exact beats a larger first-token group",
|
|
"input": {
|
|
"description": "Ica",
|
|
"history": [
|
|
{
|
|
"description": "Ica",
|
|
"category_id": "01920000-0000-7000-8000-000000000001",
|
|
"expense_date": "2026-08-01",
|
|
"created_at": "2026-08-01T12:00:00.000Z"
|
|
},
|
|
{
|
|
"description": "Ica Kvantum",
|
|
"category_id": "01920000-0000-7000-8000-000000000003",
|
|
"expense_date": "2026-09-01",
|
|
"created_at": "2026-09-01T12:00:00.000Z"
|
|
},
|
|
{
|
|
"description": "Ica Kvantum",
|
|
"category_id": "01920000-0000-7000-8000-000000000003",
|
|
"expense_date": "2026-09-02",
|
|
"created_at": "2026-09-02T12:00:00.000Z"
|
|
},
|
|
{
|
|
"description": "Ica Kvantum",
|
|
"category_id": "01920000-0000-7000-8000-000000000003",
|
|
"expense_date": "2026-09-03",
|
|
"created_at": "2026-09-03T12:00:00.000Z"
|
|
}
|
|
],
|
|
"keywords": [],
|
|
"active_categories": [
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000001",
|
|
"default_key": "groceries"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000002",
|
|
"default_key": "restaurants"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000011",
|
|
"default_key": "housing"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000003",
|
|
"default_key": "home"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000004",
|
|
"default_key": "utilities"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000012",
|
|
"default_key": "insurance"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000005",
|
|
"default_key": "transport"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000006",
|
|
"default_key": "travel"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000007",
|
|
"default_key": "entertainment"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000008",
|
|
"default_key": "health"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000013",
|
|
"default_key": "children"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000009",
|
|
"default_key": "shopping"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000014",
|
|
"default_key": "fees"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-00000000000a",
|
|
"default_key": "other"
|
|
}
|
|
],
|
|
"fallback": "01920000-0000-7000-8000-00000000000a"
|
|
},
|
|
"expected": {
|
|
"ok": "01920000-0000-7000-8000-000000000001"
|
|
}
|
|
},
|
|
{
|
|
"name": "history exact: a custom category is suggested like any other",
|
|
"input": {
|
|
"description": "Hundmat",
|
|
"history": [
|
|
{
|
|
"description": "Hundmat",
|
|
"category_id": "0192a007-0000-7000-8000-000000000001",
|
|
"expense_date": "2026-10-01",
|
|
"created_at": "2026-10-01T12:00:00.000Z"
|
|
}
|
|
],
|
|
"keywords": [],
|
|
"active_categories": [
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000001",
|
|
"default_key": "groceries"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000002",
|
|
"default_key": "restaurants"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000011",
|
|
"default_key": "housing"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000003",
|
|
"default_key": "home"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000004",
|
|
"default_key": "utilities"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000012",
|
|
"default_key": "insurance"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000005",
|
|
"default_key": "transport"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000006",
|
|
"default_key": "travel"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000007",
|
|
"default_key": "entertainment"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000008",
|
|
"default_key": "health"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000013",
|
|
"default_key": "children"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000009",
|
|
"default_key": "shopping"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000014",
|
|
"default_key": "fees"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-00000000000a",
|
|
"default_key": "other"
|
|
},
|
|
{
|
|
"id": "0192a007-0000-7000-8000-000000000001",
|
|
"default_key": null
|
|
}
|
|
],
|
|
"fallback": "01920000-0000-7000-8000-00000000000a"
|
|
},
|
|
"expected": {
|
|
"ok": "0192a007-0000-7000-8000-000000000001"
|
|
}
|
|
},
|
|
{
|
|
"name": "history exact: an archived category is left out of the count",
|
|
"input": {
|
|
"description": "Ikea",
|
|
"history": [
|
|
{
|
|
"description": "Ikea",
|
|
"category_id": "0192a007-0000-7000-8000-000000000002",
|
|
"expense_date": "2026-09-01",
|
|
"created_at": "2026-09-01T12:00:00.000Z"
|
|
},
|
|
{
|
|
"description": "IKEA",
|
|
"category_id": "0192a007-0000-7000-8000-000000000002",
|
|
"expense_date": "2026-09-02",
|
|
"created_at": "2026-09-02T12:00:00.000Z"
|
|
},
|
|
{
|
|
"description": "Ikea",
|
|
"category_id": "01920000-0000-7000-8000-000000000003",
|
|
"expense_date": "2026-08-01",
|
|
"created_at": "2026-08-01T12:00:00.000Z"
|
|
}
|
|
],
|
|
"keywords": [
|
|
{
|
|
"keyword": "ikea",
|
|
"match": "token",
|
|
"default_key": "home"
|
|
}
|
|
],
|
|
"active_categories": [
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000001",
|
|
"default_key": "groceries"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000002",
|
|
"default_key": "restaurants"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000011",
|
|
"default_key": "housing"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000003",
|
|
"default_key": "home"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000004",
|
|
"default_key": "utilities"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000012",
|
|
"default_key": "insurance"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000005",
|
|
"default_key": "transport"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000006",
|
|
"default_key": "travel"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000007",
|
|
"default_key": "entertainment"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000008",
|
|
"default_key": "health"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000013",
|
|
"default_key": "children"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000009",
|
|
"default_key": "shopping"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000014",
|
|
"default_key": "fees"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-00000000000a",
|
|
"default_key": "other"
|
|
},
|
|
{
|
|
"id": "0192a007-0000-7000-8000-000000000001",
|
|
"default_key": null
|
|
}
|
|
],
|
|
"fallback": "01920000-0000-7000-8000-00000000000a"
|
|
},
|
|
"expected": {
|
|
"ok": "01920000-0000-7000-8000-000000000003"
|
|
}
|
|
},
|
|
{
|
|
"name": "history exact: a deleted category (absent from the active list) is left out",
|
|
"input": {
|
|
"description": "Hyra",
|
|
"history": [
|
|
{
|
|
"description": "Hyra",
|
|
"category_id": "01920000-0000-7000-8000-000000000003",
|
|
"expense_date": "2026-09-25",
|
|
"created_at": "2026-09-25T12:00:00.000Z"
|
|
},
|
|
{
|
|
"description": "Hyra",
|
|
"category_id": "01920000-0000-7000-8000-000000000003",
|
|
"expense_date": "2026-08-25",
|
|
"created_at": "2026-08-25T12:00:00.000Z"
|
|
},
|
|
{
|
|
"description": "Hyra",
|
|
"category_id": "01920000-0000-7000-8000-000000000011",
|
|
"expense_date": "2026-07-25",
|
|
"created_at": "2026-07-25T12:00:00.000Z"
|
|
}
|
|
],
|
|
"keywords": [],
|
|
"active_categories": [
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000001",
|
|
"default_key": "groceries"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000002",
|
|
"default_key": "restaurants"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000011",
|
|
"default_key": "housing"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000004",
|
|
"default_key": "utilities"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000012",
|
|
"default_key": "insurance"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000005",
|
|
"default_key": "transport"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000006",
|
|
"default_key": "travel"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000007",
|
|
"default_key": "entertainment"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000008",
|
|
"default_key": "health"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000013",
|
|
"default_key": "children"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000009",
|
|
"default_key": "shopping"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000014",
|
|
"default_key": "fees"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-00000000000a",
|
|
"default_key": "other"
|
|
}
|
|
],
|
|
"fallback": "01920000-0000-7000-8000-00000000000a"
|
|
},
|
|
"expected": {
|
|
"ok": "01920000-0000-7000-8000-000000000011"
|
|
}
|
|
},
|
|
{
|
|
"name": "history exact: digits are kept, so a different number is not an exact match",
|
|
"input": {
|
|
"description": "Hyra 10",
|
|
"history": [
|
|
{
|
|
"description": "Hyra 10",
|
|
"category_id": "01920000-0000-7000-8000-000000000011",
|
|
"expense_date": "2026-10-25",
|
|
"created_at": "2026-10-25T12:00:00.000Z"
|
|
},
|
|
{
|
|
"description": "Hyra 11",
|
|
"category_id": "01920000-0000-7000-8000-000000000003",
|
|
"expense_date": "2026-09-25",
|
|
"created_at": "2026-09-25T12:00:00.000Z"
|
|
},
|
|
{
|
|
"description": "Hyra 11",
|
|
"category_id": "01920000-0000-7000-8000-000000000003",
|
|
"expense_date": "2026-08-25",
|
|
"created_at": "2026-08-25T12:00:00.000Z"
|
|
}
|
|
],
|
|
"keywords": [],
|
|
"active_categories": [
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000001",
|
|
"default_key": "groceries"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000002",
|
|
"default_key": "restaurants"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000011",
|
|
"default_key": "housing"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000003",
|
|
"default_key": "home"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000004",
|
|
"default_key": "utilities"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000012",
|
|
"default_key": "insurance"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000005",
|
|
"default_key": "transport"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000006",
|
|
"default_key": "travel"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000007",
|
|
"default_key": "entertainment"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000008",
|
|
"default_key": "health"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000013",
|
|
"default_key": "children"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000009",
|
|
"default_key": "shopping"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000014",
|
|
"default_key": "fees"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-00000000000a",
|
|
"default_key": "other"
|
|
}
|
|
],
|
|
"fallback": "01920000-0000-7000-8000-00000000000a"
|
|
},
|
|
"expected": {
|
|
"ok": "01920000-0000-7000-8000-000000000011"
|
|
}
|
|
},
|
|
{
|
|
"name": "history exact: whitespace is collapsed and trimmed",
|
|
"input": {
|
|
"description": " Ica Maxi ",
|
|
"history": [
|
|
{
|
|
"description": "ICA Maxi",
|
|
"category_id": "01920000-0000-7000-8000-000000000003",
|
|
"expense_date": "2026-10-01",
|
|
"created_at": "2026-10-01T12:00:00.000Z"
|
|
}
|
|
],
|
|
"keywords": [
|
|
{
|
|
"keyword": "ica",
|
|
"match": "token",
|
|
"default_key": "groceries"
|
|
}
|
|
],
|
|
"active_categories": [
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000001",
|
|
"default_key": "groceries"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000002",
|
|
"default_key": "restaurants"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000011",
|
|
"default_key": "housing"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000003",
|
|
"default_key": "home"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000004",
|
|
"default_key": "utilities"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000012",
|
|
"default_key": "insurance"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000005",
|
|
"default_key": "transport"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000006",
|
|
"default_key": "travel"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000007",
|
|
"default_key": "entertainment"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000008",
|
|
"default_key": "health"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000013",
|
|
"default_key": "children"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000009",
|
|
"default_key": "shopping"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000014",
|
|
"default_key": "fees"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-00000000000a",
|
|
"default_key": "other"
|
|
}
|
|
],
|
|
"fallback": "01920000-0000-7000-8000-00000000000a"
|
|
},
|
|
"expected": {
|
|
"ok": "01920000-0000-7000-8000-000000000003"
|
|
}
|
|
},
|
|
{
|
|
"name": "history exact: tab and newline count as whitespace",
|
|
"input": {
|
|
"description": "Ica\tMaxi\n",
|
|
"history": [
|
|
{
|
|
"description": "Ica Maxi",
|
|
"category_id": "01920000-0000-7000-8000-000000000003",
|
|
"expense_date": "2026-10-01",
|
|
"created_at": "2026-10-01T12:00:00.000Z"
|
|
}
|
|
],
|
|
"keywords": [
|
|
{
|
|
"keyword": "ica",
|
|
"match": "token",
|
|
"default_key": "groceries"
|
|
}
|
|
],
|
|
"active_categories": [
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000001",
|
|
"default_key": "groceries"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000002",
|
|
"default_key": "restaurants"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000011",
|
|
"default_key": "housing"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000003",
|
|
"default_key": "home"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000004",
|
|
"default_key": "utilities"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000012",
|
|
"default_key": "insurance"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000005",
|
|
"default_key": "transport"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000006",
|
|
"default_key": "travel"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000007",
|
|
"default_key": "entertainment"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000008",
|
|
"default_key": "health"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000013",
|
|
"default_key": "children"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000009",
|
|
"default_key": "shopping"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000014",
|
|
"default_key": "fees"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-00000000000a",
|
|
"default_key": "other"
|
|
}
|
|
],
|
|
"fallback": "01920000-0000-7000-8000-00000000000a"
|
|
},
|
|
"expected": {
|
|
"ok": "01920000-0000-7000-8000-000000000003"
|
|
}
|
|
},
|
|
{
|
|
"name": "history exact: a decomposed é in the typed text equals the stored composed é (NFC)",
|
|
"input": {
|
|
"description": "Cafe\u0301 Ritorno",
|
|
"history": [
|
|
{
|
|
"description": "Café Ritorno",
|
|
"category_id": "01920000-0000-7000-8000-000000000003",
|
|
"expense_date": "2026-10-01",
|
|
"created_at": "2026-10-01T12:00:00.000Z"
|
|
}
|
|
],
|
|
"keywords": [
|
|
{
|
|
"keyword": "café",
|
|
"match": "token",
|
|
"default_key": "restaurants"
|
|
}
|
|
],
|
|
"active_categories": [
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000001",
|
|
"default_key": "groceries"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000002",
|
|
"default_key": "restaurants"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000011",
|
|
"default_key": "housing"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000003",
|
|
"default_key": "home"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000004",
|
|
"default_key": "utilities"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000012",
|
|
"default_key": "insurance"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000005",
|
|
"default_key": "transport"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000006",
|
|
"default_key": "travel"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000007",
|
|
"default_key": "entertainment"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000008",
|
|
"default_key": "health"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000013",
|
|
"default_key": "children"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000009",
|
|
"default_key": "shopping"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000014",
|
|
"default_key": "fees"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-00000000000a",
|
|
"default_key": "other"
|
|
}
|
|
],
|
|
"fallback": "01920000-0000-7000-8000-00000000000a"
|
|
},
|
|
"expected": {
|
|
"ok": "01920000-0000-7000-8000-000000000003"
|
|
}
|
|
},
|
|
{
|
|
"name": "history exact: a colon in the stored description is deleted",
|
|
"input": {
|
|
"description": "Willys",
|
|
"history": [
|
|
{
|
|
"description": "WILLY:S",
|
|
"category_id": "01920000-0000-7000-8000-000000000003",
|
|
"expense_date": "2026-10-01",
|
|
"created_at": "2026-10-01T12:00:00.000Z"
|
|
}
|
|
],
|
|
"keywords": [
|
|
{
|
|
"keyword": "willys",
|
|
"match": "token",
|
|
"default_key": "groceries"
|
|
}
|
|
],
|
|
"active_categories": [
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000001",
|
|
"default_key": "groceries"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000002",
|
|
"default_key": "restaurants"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000011",
|
|
"default_key": "housing"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000003",
|
|
"default_key": "home"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000004",
|
|
"default_key": "utilities"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000012",
|
|
"default_key": "insurance"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000005",
|
|
"default_key": "transport"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000006",
|
|
"default_key": "travel"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000007",
|
|
"default_key": "entertainment"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000008",
|
|
"default_key": "health"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000013",
|
|
"default_key": "children"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000009",
|
|
"default_key": "shopping"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000014",
|
|
"default_key": "fees"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-00000000000a",
|
|
"default_key": "other"
|
|
}
|
|
],
|
|
"fallback": "01920000-0000-7000-8000-00000000000a"
|
|
},
|
|
"expected": {
|
|
"ok": "01920000-0000-7000-8000-000000000003"
|
|
}
|
|
},
|
|
{
|
|
"name": "history first token when there is no exact match",
|
|
"input": {
|
|
"description": "Ica Kvantum Lund",
|
|
"history": [
|
|
{
|
|
"description": "ICA Maxi",
|
|
"category_id": "01920000-0000-7000-8000-000000000003",
|
|
"expense_date": "2026-09-01",
|
|
"created_at": "2026-09-01T12:00:00.000Z"
|
|
},
|
|
{
|
|
"description": "Ica Maxi",
|
|
"category_id": "01920000-0000-7000-8000-000000000003",
|
|
"expense_date": "2026-09-08",
|
|
"created_at": "2026-09-08T12:00:00.000Z"
|
|
},
|
|
{
|
|
"description": "Coop",
|
|
"category_id": "01920000-0000-7000-8000-000000000001",
|
|
"expense_date": "2026-10-01",
|
|
"created_at": "2026-10-01T12:00:00.000Z"
|
|
}
|
|
],
|
|
"keywords": [
|
|
{
|
|
"keyword": "coop",
|
|
"match": "token",
|
|
"default_key": "groceries"
|
|
},
|
|
{
|
|
"keyword": "ica",
|
|
"match": "token",
|
|
"default_key": "groceries"
|
|
}
|
|
],
|
|
"active_categories": [
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000001",
|
|
"default_key": "groceries"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000002",
|
|
"default_key": "restaurants"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000011",
|
|
"default_key": "housing"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000003",
|
|
"default_key": "home"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000004",
|
|
"default_key": "utilities"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000012",
|
|
"default_key": "insurance"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000005",
|
|
"default_key": "transport"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000006",
|
|
"default_key": "travel"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000007",
|
|
"default_key": "entertainment"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000008",
|
|
"default_key": "health"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000013",
|
|
"default_key": "children"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000009",
|
|
"default_key": "shopping"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000014",
|
|
"default_key": "fees"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-00000000000a",
|
|
"default_key": "other"
|
|
}
|
|
],
|
|
"fallback": "01920000-0000-7000-8000-00000000000a"
|
|
},
|
|
"expected": {
|
|
"ok": "01920000-0000-7000-8000-000000000003"
|
|
}
|
|
},
|
|
{
|
|
"name": "history first token: most often",
|
|
"input": {
|
|
"description": "Taxi hem",
|
|
"history": [
|
|
{
|
|
"description": "Taxi Stockholm",
|
|
"category_id": "01920000-0000-7000-8000-000000000006",
|
|
"expense_date": "2026-05-01",
|
|
"created_at": "2026-05-01T12:00:00.000Z"
|
|
},
|
|
{
|
|
"description": "taxi kurir",
|
|
"category_id": "01920000-0000-7000-8000-000000000005",
|
|
"expense_date": "2026-06-01",
|
|
"created_at": "2026-06-01T12:00:00.000Z"
|
|
},
|
|
{
|
|
"description": "Taxi Göteborg",
|
|
"category_id": "01920000-0000-7000-8000-000000000006",
|
|
"expense_date": "2026-04-01",
|
|
"created_at": "2026-04-01T12:00:00.000Z"
|
|
}
|
|
],
|
|
"keywords": [
|
|
{
|
|
"keyword": "taxi",
|
|
"match": "token",
|
|
"default_key": "transport"
|
|
}
|
|
],
|
|
"active_categories": [
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000001",
|
|
"default_key": "groceries"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000002",
|
|
"default_key": "restaurants"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000011",
|
|
"default_key": "housing"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000003",
|
|
"default_key": "home"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000004",
|
|
"default_key": "utilities"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000012",
|
|
"default_key": "insurance"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000005",
|
|
"default_key": "transport"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000006",
|
|
"default_key": "travel"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000007",
|
|
"default_key": "entertainment"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000008",
|
|
"default_key": "health"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000013",
|
|
"default_key": "children"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000009",
|
|
"default_key": "shopping"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000014",
|
|
"default_key": "fees"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-00000000000a",
|
|
"default_key": "other"
|
|
}
|
|
],
|
|
"fallback": "01920000-0000-7000-8000-00000000000a"
|
|
},
|
|
"expected": {
|
|
"ok": "01920000-0000-7000-8000-000000000006"
|
|
}
|
|
},
|
|
{
|
|
"name": "history first token: a tie on count goes to the most recent",
|
|
"input": {
|
|
"description": "Mat ute",
|
|
"history": [
|
|
{
|
|
"description": "mat hemma",
|
|
"category_id": "01920000-0000-7000-8000-000000000001",
|
|
"expense_date": "2026-09-01",
|
|
"created_at": "2026-09-01T12:00:00.000Z"
|
|
},
|
|
{
|
|
"description": "mat på stan",
|
|
"category_id": "01920000-0000-7000-8000-000000000002",
|
|
"expense_date": "2026-09-15",
|
|
"created_at": "2026-09-15T12:00:00.000Z"
|
|
}
|
|
],
|
|
"keywords": [
|
|
{
|
|
"keyword": "mat",
|
|
"match": "token",
|
|
"default_key": "groceries"
|
|
}
|
|
],
|
|
"active_categories": [
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000001",
|
|
"default_key": "groceries"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000002",
|
|
"default_key": "restaurants"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000011",
|
|
"default_key": "housing"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000003",
|
|
"default_key": "home"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000004",
|
|
"default_key": "utilities"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000012",
|
|
"default_key": "insurance"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000005",
|
|
"default_key": "transport"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000006",
|
|
"default_key": "travel"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000007",
|
|
"default_key": "entertainment"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000008",
|
|
"default_key": "health"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000013",
|
|
"default_key": "children"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000009",
|
|
"default_key": "shopping"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000014",
|
|
"default_key": "fees"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-00000000000a",
|
|
"default_key": "other"
|
|
}
|
|
],
|
|
"fallback": "01920000-0000-7000-8000-00000000000a"
|
|
},
|
|
"expected": {
|
|
"ok": "01920000-0000-7000-8000-000000000002"
|
|
}
|
|
},
|
|
{
|
|
"name": "history first token: only the first token counts, not a later one",
|
|
"input": {
|
|
"description": "Lunch Ica",
|
|
"history": [
|
|
{
|
|
"description": "Ica lunch",
|
|
"category_id": "01920000-0000-7000-8000-000000000003",
|
|
"expense_date": "2026-10-01",
|
|
"created_at": "2026-10-01T12:00:00.000Z"
|
|
}
|
|
],
|
|
"keywords": [
|
|
{
|
|
"keyword": "ica",
|
|
"match": "token",
|
|
"default_key": "groceries"
|
|
},
|
|
{
|
|
"keyword": "lunch",
|
|
"match": "token",
|
|
"default_key": "restaurants"
|
|
}
|
|
],
|
|
"active_categories": [
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000001",
|
|
"default_key": "groceries"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000002",
|
|
"default_key": "restaurants"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000011",
|
|
"default_key": "housing"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000003",
|
|
"default_key": "home"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000004",
|
|
"default_key": "utilities"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000012",
|
|
"default_key": "insurance"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000005",
|
|
"default_key": "transport"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000006",
|
|
"default_key": "travel"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000007",
|
|
"default_key": "entertainment"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000008",
|
|
"default_key": "health"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000013",
|
|
"default_key": "children"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000009",
|
|
"default_key": "shopping"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000014",
|
|
"default_key": "fees"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-00000000000a",
|
|
"default_key": "other"
|
|
}
|
|
],
|
|
"fallback": "01920000-0000-7000-8000-00000000000a"
|
|
},
|
|
"expected": {
|
|
"ok": "01920000-0000-7000-8000-000000000002"
|
|
}
|
|
},
|
|
{
|
|
"name": "history first token: every exact match archived falls through to the first token",
|
|
"input": {
|
|
"description": "Ikea",
|
|
"history": [
|
|
{
|
|
"description": "Ikea",
|
|
"category_id": "0192a007-0000-7000-8000-000000000002",
|
|
"expense_date": "2026-09-01",
|
|
"created_at": "2026-09-01T12:00:00.000Z"
|
|
},
|
|
{
|
|
"description": "Ikea",
|
|
"category_id": "0192a007-0000-7000-8000-000000000002",
|
|
"expense_date": "2026-09-02",
|
|
"created_at": "2026-09-02T12:00:00.000Z"
|
|
},
|
|
{
|
|
"description": "Ikea Kungens Kurva",
|
|
"category_id": "01920000-0000-7000-8000-000000000009",
|
|
"expense_date": "2026-08-01",
|
|
"created_at": "2026-08-01T12:00:00.000Z"
|
|
}
|
|
],
|
|
"keywords": [
|
|
{
|
|
"keyword": "ikea",
|
|
"match": "token",
|
|
"default_key": "home"
|
|
}
|
|
],
|
|
"active_categories": [
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000001",
|
|
"default_key": "groceries"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000002",
|
|
"default_key": "restaurants"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000011",
|
|
"default_key": "housing"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000003",
|
|
"default_key": "home"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000004",
|
|
"default_key": "utilities"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000012",
|
|
"default_key": "insurance"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000005",
|
|
"default_key": "transport"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000006",
|
|
"default_key": "travel"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000007",
|
|
"default_key": "entertainment"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000008",
|
|
"default_key": "health"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000013",
|
|
"default_key": "children"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000009",
|
|
"default_key": "shopping"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000014",
|
|
"default_key": "fees"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-00000000000a",
|
|
"default_key": "other"
|
|
}
|
|
],
|
|
"fallback": "01920000-0000-7000-8000-00000000000a"
|
|
},
|
|
"expected": {
|
|
"ok": "01920000-0000-7000-8000-000000000009"
|
|
}
|
|
},
|
|
{
|
|
"name": "history first token: a stored description that normalises to empty has no first token",
|
|
"input": {
|
|
"description": "Ica",
|
|
"history": [
|
|
{
|
|
"description": "??",
|
|
"category_id": "01920000-0000-7000-8000-000000000003",
|
|
"expense_date": "2026-10-01",
|
|
"created_at": "2026-10-01T12:00:00.000Z"
|
|
}
|
|
],
|
|
"keywords": [
|
|
{
|
|
"keyword": "ica",
|
|
"match": "token",
|
|
"default_key": "groceries"
|
|
}
|
|
],
|
|
"active_categories": [
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000001",
|
|
"default_key": "groceries"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000002",
|
|
"default_key": "restaurants"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000011",
|
|
"default_key": "housing"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000003",
|
|
"default_key": "home"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000004",
|
|
"default_key": "utilities"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000012",
|
|
"default_key": "insurance"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000005",
|
|
"default_key": "transport"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000006",
|
|
"default_key": "travel"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000007",
|
|
"default_key": "entertainment"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000008",
|
|
"default_key": "health"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000013",
|
|
"default_key": "children"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000009",
|
|
"default_key": "shopping"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000014",
|
|
"default_key": "fees"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-00000000000a",
|
|
"default_key": "other"
|
|
}
|
|
],
|
|
"fallback": "01920000-0000-7000-8000-00000000000a"
|
|
},
|
|
"expected": {
|
|
"ok": "01920000-0000-7000-8000-000000000001"
|
|
}
|
|
},
|
|
{
|
|
"name": "history beats the keyword table",
|
|
"input": {
|
|
"description": "Willys",
|
|
"history": [
|
|
{
|
|
"description": "willys",
|
|
"category_id": "01920000-0000-7000-8000-000000000003",
|
|
"expense_date": "2026-10-01",
|
|
"created_at": "2026-10-01T12:00:00.000Z"
|
|
}
|
|
],
|
|
"keywords": [
|
|
{
|
|
"keyword": "willys",
|
|
"match": "token",
|
|
"default_key": "groceries"
|
|
}
|
|
],
|
|
"active_categories": [
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000001",
|
|
"default_key": "groceries"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000002",
|
|
"default_key": "restaurants"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000011",
|
|
"default_key": "housing"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000003",
|
|
"default_key": "home"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000004",
|
|
"default_key": "utilities"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000012",
|
|
"default_key": "insurance"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000005",
|
|
"default_key": "transport"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000006",
|
|
"default_key": "travel"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000007",
|
|
"default_key": "entertainment"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000008",
|
|
"default_key": "health"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000013",
|
|
"default_key": "children"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000009",
|
|
"default_key": "shopping"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000014",
|
|
"default_key": "fees"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-00000000000a",
|
|
"default_key": "other"
|
|
}
|
|
],
|
|
"fallback": "01920000-0000-7000-8000-00000000000a"
|
|
},
|
|
"expected": {
|
|
"ok": "01920000-0000-7000-8000-000000000003"
|
|
}
|
|
},
|
|
{
|
|
"name": "every history match archived falls through to the keywords",
|
|
"input": {
|
|
"description": "Ikea",
|
|
"history": [
|
|
{
|
|
"description": "Ikea",
|
|
"category_id": "0192a007-0000-7000-8000-000000000002",
|
|
"expense_date": "2026-09-01",
|
|
"created_at": "2026-09-01T12:00:00.000Z"
|
|
},
|
|
{
|
|
"description": "IKEA Backebol",
|
|
"category_id": "0192a007-0000-7000-8000-000000000002",
|
|
"expense_date": "2026-09-02",
|
|
"created_at": "2026-09-02T12:00:00.000Z"
|
|
}
|
|
],
|
|
"keywords": [
|
|
{
|
|
"keyword": "ikea",
|
|
"match": "token",
|
|
"default_key": "home"
|
|
}
|
|
],
|
|
"active_categories": [
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000001",
|
|
"default_key": "groceries"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000002",
|
|
"default_key": "restaurants"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000011",
|
|
"default_key": "housing"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000003",
|
|
"default_key": "home"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000004",
|
|
"default_key": "utilities"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000012",
|
|
"default_key": "insurance"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000005",
|
|
"default_key": "transport"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000006",
|
|
"default_key": "travel"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000007",
|
|
"default_key": "entertainment"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000008",
|
|
"default_key": "health"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000013",
|
|
"default_key": "children"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000009",
|
|
"default_key": "shopping"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000014",
|
|
"default_key": "fees"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-00000000000a",
|
|
"default_key": "other"
|
|
}
|
|
],
|
|
"fallback": "01920000-0000-7000-8000-00000000000a"
|
|
},
|
|
"expected": {
|
|
"ok": "01920000-0000-7000-8000-000000000003"
|
|
}
|
|
},
|
|
{
|
|
"name": "keyword token",
|
|
"input": {
|
|
"description": "Netflix",
|
|
"history": [],
|
|
"keywords": [
|
|
{
|
|
"keyword": "netflix",
|
|
"match": "token",
|
|
"default_key": "entertainment"
|
|
},
|
|
{
|
|
"keyword": "spotify",
|
|
"match": "token",
|
|
"default_key": "entertainment"
|
|
}
|
|
],
|
|
"active_categories": [
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000001",
|
|
"default_key": "groceries"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000002",
|
|
"default_key": "restaurants"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000011",
|
|
"default_key": "housing"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000003",
|
|
"default_key": "home"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000004",
|
|
"default_key": "utilities"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000012",
|
|
"default_key": "insurance"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000005",
|
|
"default_key": "transport"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000006",
|
|
"default_key": "travel"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000007",
|
|
"default_key": "entertainment"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000008",
|
|
"default_key": "health"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000013",
|
|
"default_key": "children"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000009",
|
|
"default_key": "shopping"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000014",
|
|
"default_key": "fees"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-00000000000a",
|
|
"default_key": "other"
|
|
}
|
|
],
|
|
"fallback": "01920000-0000-7000-8000-00000000000a"
|
|
},
|
|
"expected": {
|
|
"ok": "01920000-0000-7000-8000-000000000007"
|
|
}
|
|
},
|
|
{
|
|
"name": "keyword token does not match a longer token",
|
|
"input": {
|
|
"description": "Bilar",
|
|
"history": [],
|
|
"keywords": [
|
|
{
|
|
"keyword": "bil",
|
|
"match": "token",
|
|
"default_key": "transport"
|
|
}
|
|
],
|
|
"active_categories": [
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000001",
|
|
"default_key": "groceries"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000002",
|
|
"default_key": "restaurants"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000011",
|
|
"default_key": "housing"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000003",
|
|
"default_key": "home"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000004",
|
|
"default_key": "utilities"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000012",
|
|
"default_key": "insurance"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000005",
|
|
"default_key": "transport"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000006",
|
|
"default_key": "travel"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000007",
|
|
"default_key": "entertainment"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000008",
|
|
"default_key": "health"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000013",
|
|
"default_key": "children"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000009",
|
|
"default_key": "shopping"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000014",
|
|
"default_key": "fees"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-00000000000a",
|
|
"default_key": "other"
|
|
}
|
|
],
|
|
"fallback": "01920000-0000-7000-8000-00000000000a"
|
|
},
|
|
"expected": {
|
|
"ok": "01920000-0000-7000-8000-00000000000a"
|
|
}
|
|
},
|
|
{
|
|
"name": "keyword prefix",
|
|
"input": {
|
|
"description": "Pizzeria Napoli",
|
|
"history": [],
|
|
"keywords": [
|
|
{
|
|
"keyword": "pizz",
|
|
"match": "prefix",
|
|
"default_key": "restaurants"
|
|
}
|
|
],
|
|
"active_categories": [
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000001",
|
|
"default_key": "groceries"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000002",
|
|
"default_key": "restaurants"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000011",
|
|
"default_key": "housing"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000003",
|
|
"default_key": "home"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000004",
|
|
"default_key": "utilities"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000012",
|
|
"default_key": "insurance"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000005",
|
|
"default_key": "transport"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000006",
|
|
"default_key": "travel"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000007",
|
|
"default_key": "entertainment"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000008",
|
|
"default_key": "health"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000013",
|
|
"default_key": "children"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000009",
|
|
"default_key": "shopping"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000014",
|
|
"default_key": "fees"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-00000000000a",
|
|
"default_key": "other"
|
|
}
|
|
],
|
|
"fallback": "01920000-0000-7000-8000-00000000000a"
|
|
},
|
|
"expected": {
|
|
"ok": "01920000-0000-7000-8000-000000000002"
|
|
}
|
|
},
|
|
{
|
|
"name": "keyword prefix matches only at the start of a token",
|
|
"input": {
|
|
"description": "Snabbpizza",
|
|
"history": [],
|
|
"keywords": [
|
|
{
|
|
"keyword": "pizz",
|
|
"match": "prefix",
|
|
"default_key": "restaurants"
|
|
}
|
|
],
|
|
"active_categories": [
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000001",
|
|
"default_key": "groceries"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000002",
|
|
"default_key": "restaurants"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000011",
|
|
"default_key": "housing"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000003",
|
|
"default_key": "home"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000004",
|
|
"default_key": "utilities"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000012",
|
|
"default_key": "insurance"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000005",
|
|
"default_key": "transport"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000006",
|
|
"default_key": "travel"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000007",
|
|
"default_key": "entertainment"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000008",
|
|
"default_key": "health"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000013",
|
|
"default_key": "children"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000009",
|
|
"default_key": "shopping"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000014",
|
|
"default_key": "fees"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-00000000000a",
|
|
"default_key": "other"
|
|
}
|
|
],
|
|
"fallback": "01920000-0000-7000-8000-00000000000a"
|
|
},
|
|
"expected": {
|
|
"ok": "01920000-0000-7000-8000-00000000000a"
|
|
}
|
|
},
|
|
{
|
|
"name": "keyword prefix also matches the whole token",
|
|
"input": {
|
|
"description": "Apotek",
|
|
"history": [],
|
|
"keywords": [
|
|
{
|
|
"keyword": "apotek",
|
|
"match": "prefix",
|
|
"default_key": "health"
|
|
}
|
|
],
|
|
"active_categories": [
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000001",
|
|
"default_key": "groceries"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000002",
|
|
"default_key": "restaurants"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000011",
|
|
"default_key": "housing"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000003",
|
|
"default_key": "home"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000004",
|
|
"default_key": "utilities"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000012",
|
|
"default_key": "insurance"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000005",
|
|
"default_key": "transport"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000006",
|
|
"default_key": "travel"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000007",
|
|
"default_key": "entertainment"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000008",
|
|
"default_key": "health"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000013",
|
|
"default_key": "children"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000009",
|
|
"default_key": "shopping"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000014",
|
|
"default_key": "fees"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-00000000000a",
|
|
"default_key": "other"
|
|
}
|
|
],
|
|
"fallback": "01920000-0000-7000-8000-00000000000a"
|
|
},
|
|
"expected": {
|
|
"ok": "01920000-0000-7000-8000-000000000008"
|
|
}
|
|
},
|
|
{
|
|
"name": "keyword phrase",
|
|
"input": {
|
|
"description": "Bondens marknad Lund",
|
|
"history": [],
|
|
"keywords": [
|
|
{
|
|
"keyword": "bondens marknad",
|
|
"match": "phrase",
|
|
"default_key": "groceries"
|
|
}
|
|
],
|
|
"active_categories": [
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000001",
|
|
"default_key": "groceries"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000002",
|
|
"default_key": "restaurants"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000011",
|
|
"default_key": "housing"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000003",
|
|
"default_key": "home"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000004",
|
|
"default_key": "utilities"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000012",
|
|
"default_key": "insurance"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000005",
|
|
"default_key": "transport"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000006",
|
|
"default_key": "travel"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000007",
|
|
"default_key": "entertainment"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000008",
|
|
"default_key": "health"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000013",
|
|
"default_key": "children"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000009",
|
|
"default_key": "shopping"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000014",
|
|
"default_key": "fees"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-00000000000a",
|
|
"default_key": "other"
|
|
}
|
|
],
|
|
"fallback": "01920000-0000-7000-8000-00000000000a"
|
|
},
|
|
"expected": {
|
|
"ok": "01920000-0000-7000-8000-000000000001"
|
|
}
|
|
},
|
|
{
|
|
"name": "keyword phrase needs the tokens consecutive and in order",
|
|
"input": {
|
|
"description": "Bondens stora marknad, marknad bondens",
|
|
"history": [],
|
|
"keywords": [
|
|
{
|
|
"keyword": "bondens marknad",
|
|
"match": "phrase",
|
|
"default_key": "groceries"
|
|
}
|
|
],
|
|
"active_categories": [
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000001",
|
|
"default_key": "groceries"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000002",
|
|
"default_key": "restaurants"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000011",
|
|
"default_key": "housing"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000003",
|
|
"default_key": "home"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000004",
|
|
"default_key": "utilities"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000012",
|
|
"default_key": "insurance"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000005",
|
|
"default_key": "transport"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000006",
|
|
"default_key": "travel"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000007",
|
|
"default_key": "entertainment"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000008",
|
|
"default_key": "health"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000013",
|
|
"default_key": "children"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000009",
|
|
"default_key": "shopping"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000014",
|
|
"default_key": "fees"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-00000000000a",
|
|
"default_key": "other"
|
|
}
|
|
],
|
|
"fallback": "01920000-0000-7000-8000-00000000000a"
|
|
},
|
|
"expected": {
|
|
"ok": "01920000-0000-7000-8000-00000000000a"
|
|
}
|
|
},
|
|
{
|
|
"name": "keyword phrase matches across punctuation",
|
|
"input": {
|
|
"description": "Burger-King",
|
|
"history": [],
|
|
"keywords": [
|
|
{
|
|
"keyword": "burger king",
|
|
"match": "phrase",
|
|
"default_key": "restaurants"
|
|
}
|
|
],
|
|
"active_categories": [
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000001",
|
|
"default_key": "groceries"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000002",
|
|
"default_key": "restaurants"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000011",
|
|
"default_key": "housing"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000003",
|
|
"default_key": "home"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000004",
|
|
"default_key": "utilities"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000012",
|
|
"default_key": "insurance"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000005",
|
|
"default_key": "transport"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000006",
|
|
"default_key": "travel"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000007",
|
|
"default_key": "entertainment"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000008",
|
|
"default_key": "health"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000013",
|
|
"default_key": "children"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000009",
|
|
"default_key": "shopping"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000014",
|
|
"default_key": "fees"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-00000000000a",
|
|
"default_key": "other"
|
|
}
|
|
],
|
|
"fallback": "01920000-0000-7000-8000-00000000000a"
|
|
},
|
|
"expected": {
|
|
"ok": "01920000-0000-7000-8000-000000000002"
|
|
}
|
|
},
|
|
{
|
|
"name": "keyword phrase does not match the words run together",
|
|
"input": {
|
|
"description": "Ubereats",
|
|
"history": [],
|
|
"keywords": [
|
|
{
|
|
"keyword": "uber eats",
|
|
"match": "phrase",
|
|
"default_key": "restaurants"
|
|
},
|
|
{
|
|
"keyword": "uber",
|
|
"match": "token",
|
|
"default_key": "transport"
|
|
}
|
|
],
|
|
"active_categories": [
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000001",
|
|
"default_key": "groceries"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000002",
|
|
"default_key": "restaurants"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000011",
|
|
"default_key": "housing"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000003",
|
|
"default_key": "home"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000004",
|
|
"default_key": "utilities"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000012",
|
|
"default_key": "insurance"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000005",
|
|
"default_key": "transport"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000006",
|
|
"default_key": "travel"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000007",
|
|
"default_key": "entertainment"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000008",
|
|
"default_key": "health"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000013",
|
|
"default_key": "children"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000009",
|
|
"default_key": "shopping"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000014",
|
|
"default_key": "fees"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-00000000000a",
|
|
"default_key": "other"
|
|
}
|
|
],
|
|
"fallback": "01920000-0000-7000-8000-00000000000a"
|
|
},
|
|
"expected": {
|
|
"ok": "01920000-0000-7000-8000-00000000000a"
|
|
}
|
|
},
|
|
{
|
|
"name": "longest keyword wins: phrase over token in another category",
|
|
"input": {
|
|
"description": "Uber Eats",
|
|
"history": [],
|
|
"keywords": [
|
|
{
|
|
"keyword": "uber eats",
|
|
"match": "phrase",
|
|
"default_key": "restaurants"
|
|
},
|
|
{
|
|
"keyword": "uber",
|
|
"match": "token",
|
|
"default_key": "transport"
|
|
}
|
|
],
|
|
"active_categories": [
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000001",
|
|
"default_key": "groceries"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000002",
|
|
"default_key": "restaurants"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000011",
|
|
"default_key": "housing"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000003",
|
|
"default_key": "home"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000004",
|
|
"default_key": "utilities"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000012",
|
|
"default_key": "insurance"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000005",
|
|
"default_key": "transport"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000006",
|
|
"default_key": "travel"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000007",
|
|
"default_key": "entertainment"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000008",
|
|
"default_key": "health"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000013",
|
|
"default_key": "children"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000009",
|
|
"default_key": "shopping"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000014",
|
|
"default_key": "fees"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-00000000000a",
|
|
"default_key": "other"
|
|
}
|
|
],
|
|
"fallback": "01920000-0000-7000-8000-00000000000a"
|
|
},
|
|
"expected": {
|
|
"ok": "01920000-0000-7000-8000-000000000002"
|
|
}
|
|
},
|
|
{
|
|
"name": "longest keyword wins: barnförsäkring over the prefix barn",
|
|
"input": {
|
|
"description": "Barnförsäkring",
|
|
"history": [],
|
|
"keywords": [
|
|
{
|
|
"keyword": "barn",
|
|
"match": "prefix",
|
|
"default_key": "children"
|
|
},
|
|
{
|
|
"keyword": "barnförsäkring",
|
|
"match": "token",
|
|
"default_key": "insurance"
|
|
}
|
|
],
|
|
"active_categories": [
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000001",
|
|
"default_key": "groceries"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000002",
|
|
"default_key": "restaurants"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000011",
|
|
"default_key": "housing"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000003",
|
|
"default_key": "home"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000004",
|
|
"default_key": "utilities"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000012",
|
|
"default_key": "insurance"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000005",
|
|
"default_key": "transport"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000006",
|
|
"default_key": "travel"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000007",
|
|
"default_key": "entertainment"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000008",
|
|
"default_key": "health"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000013",
|
|
"default_key": "children"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000009",
|
|
"default_key": "shopping"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000014",
|
|
"default_key": "fees"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-00000000000a",
|
|
"default_key": "other"
|
|
}
|
|
],
|
|
"fallback": "01920000-0000-7000-8000-00000000000a"
|
|
},
|
|
"expected": {
|
|
"ok": "01920000-0000-7000-8000-000000000012"
|
|
}
|
|
},
|
|
{
|
|
"name": "longest keyword wins wherever it is in the description",
|
|
"input": {
|
|
"description": "Fika på Bauhaus",
|
|
"history": [],
|
|
"keywords": [
|
|
{
|
|
"keyword": "bauhaus",
|
|
"match": "token",
|
|
"default_key": "home"
|
|
},
|
|
{
|
|
"keyword": "fika",
|
|
"match": "prefix",
|
|
"default_key": "restaurants"
|
|
}
|
|
],
|
|
"active_categories": [
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000001",
|
|
"default_key": "groceries"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000002",
|
|
"default_key": "restaurants"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000011",
|
|
"default_key": "housing"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000003",
|
|
"default_key": "home"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000004",
|
|
"default_key": "utilities"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000012",
|
|
"default_key": "insurance"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000005",
|
|
"default_key": "transport"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000006",
|
|
"default_key": "travel"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000007",
|
|
"default_key": "entertainment"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000008",
|
|
"default_key": "health"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000013",
|
|
"default_key": "children"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000009",
|
|
"default_key": "shopping"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000014",
|
|
"default_key": "fees"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-00000000000a",
|
|
"default_key": "other"
|
|
}
|
|
],
|
|
"fallback": "01920000-0000-7000-8000-00000000000a"
|
|
},
|
|
"expected": {
|
|
"ok": "01920000-0000-7000-8000-000000000003"
|
|
}
|
|
},
|
|
{
|
|
"name": "equal length: the entry earlier in the table wins",
|
|
"input": {
|
|
"description": "Bio och mat",
|
|
"history": [],
|
|
"keywords": [
|
|
{
|
|
"keyword": "bio",
|
|
"match": "token",
|
|
"default_key": "entertainment"
|
|
},
|
|
{
|
|
"keyword": "mat",
|
|
"match": "token",
|
|
"default_key": "groceries"
|
|
}
|
|
],
|
|
"active_categories": [
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000001",
|
|
"default_key": "groceries"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000002",
|
|
"default_key": "restaurants"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000011",
|
|
"default_key": "housing"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000003",
|
|
"default_key": "home"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000004",
|
|
"default_key": "utilities"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000012",
|
|
"default_key": "insurance"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000005",
|
|
"default_key": "transport"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000006",
|
|
"default_key": "travel"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000007",
|
|
"default_key": "entertainment"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000008",
|
|
"default_key": "health"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000013",
|
|
"default_key": "children"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000009",
|
|
"default_key": "shopping"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000014",
|
|
"default_key": "fees"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-00000000000a",
|
|
"default_key": "other"
|
|
}
|
|
],
|
|
"fallback": "01920000-0000-7000-8000-00000000000a"
|
|
},
|
|
"expected": {
|
|
"ok": "01920000-0000-7000-8000-000000000007"
|
|
}
|
|
},
|
|
{
|
|
"name": "equal length: the table order decides, not the order in the description",
|
|
"input": {
|
|
"description": "Mat och bio",
|
|
"history": [],
|
|
"keywords": [
|
|
{
|
|
"keyword": "bio",
|
|
"match": "token",
|
|
"default_key": "entertainment"
|
|
},
|
|
{
|
|
"keyword": "mat",
|
|
"match": "token",
|
|
"default_key": "groceries"
|
|
}
|
|
],
|
|
"active_categories": [
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000001",
|
|
"default_key": "groceries"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000002",
|
|
"default_key": "restaurants"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000011",
|
|
"default_key": "housing"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000003",
|
|
"default_key": "home"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000004",
|
|
"default_key": "utilities"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000012",
|
|
"default_key": "insurance"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000005",
|
|
"default_key": "transport"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000006",
|
|
"default_key": "travel"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000007",
|
|
"default_key": "entertainment"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000008",
|
|
"default_key": "health"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000013",
|
|
"default_key": "children"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000009",
|
|
"default_key": "shopping"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000014",
|
|
"default_key": "fees"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-00000000000a",
|
|
"default_key": "other"
|
|
}
|
|
],
|
|
"fallback": "01920000-0000-7000-8000-00000000000a"
|
|
},
|
|
"expected": {
|
|
"ok": "01920000-0000-7000-8000-000000000007"
|
|
}
|
|
},
|
|
{
|
|
"name": "archived keyword category falls through to the next matching entry",
|
|
"input": {
|
|
"description": "Uber Eats",
|
|
"history": [],
|
|
"keywords": [
|
|
{
|
|
"keyword": "uber eats",
|
|
"match": "phrase",
|
|
"default_key": "restaurants"
|
|
},
|
|
{
|
|
"keyword": "uber",
|
|
"match": "token",
|
|
"default_key": "transport"
|
|
}
|
|
],
|
|
"active_categories": [
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000001",
|
|
"default_key": "groceries"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000011",
|
|
"default_key": "housing"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000003",
|
|
"default_key": "home"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000004",
|
|
"default_key": "utilities"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000012",
|
|
"default_key": "insurance"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000005",
|
|
"default_key": "transport"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000006",
|
|
"default_key": "travel"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000007",
|
|
"default_key": "entertainment"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000008",
|
|
"default_key": "health"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000013",
|
|
"default_key": "children"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000009",
|
|
"default_key": "shopping"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000014",
|
|
"default_key": "fees"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-00000000000a",
|
|
"default_key": "other"
|
|
}
|
|
],
|
|
"fallback": "01920000-0000-7000-8000-00000000000a"
|
|
},
|
|
"expected": {
|
|
"ok": "01920000-0000-7000-8000-000000000005"
|
|
}
|
|
},
|
|
{
|
|
"name": "archived keyword category with no other match gives the fallback",
|
|
"input": {
|
|
"description": "Netflix",
|
|
"history": [],
|
|
"keywords": [
|
|
{
|
|
"keyword": "netflix",
|
|
"match": "token",
|
|
"default_key": "entertainment"
|
|
}
|
|
],
|
|
"active_categories": [
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000001",
|
|
"default_key": "groceries"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000002",
|
|
"default_key": "restaurants"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000011",
|
|
"default_key": "housing"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000003",
|
|
"default_key": "home"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000004",
|
|
"default_key": "utilities"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000012",
|
|
"default_key": "insurance"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000005",
|
|
"default_key": "transport"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000006",
|
|
"default_key": "travel"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000008",
|
|
"default_key": "health"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000013",
|
|
"default_key": "children"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000009",
|
|
"default_key": "shopping"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000014",
|
|
"default_key": "fees"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-00000000000a",
|
|
"default_key": "other"
|
|
}
|
|
],
|
|
"fallback": "01920000-0000-7000-8000-00000000000a"
|
|
},
|
|
"expected": {
|
|
"ok": "01920000-0000-7000-8000-00000000000a"
|
|
}
|
|
},
|
|
{
|
|
"name": "renamed default category is still found by its default_key",
|
|
"input": {
|
|
"description": "Hyra mars",
|
|
"history": [],
|
|
"keywords": [
|
|
{
|
|
"keyword": "hyra",
|
|
"match": "token",
|
|
"default_key": "housing"
|
|
}
|
|
],
|
|
"active_categories": [
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000001",
|
|
"default_key": "groceries"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000002",
|
|
"default_key": "restaurants"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000011",
|
|
"default_key": "housing"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000003",
|
|
"default_key": "home"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000004",
|
|
"default_key": "utilities"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000012",
|
|
"default_key": "insurance"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000005",
|
|
"default_key": "transport"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000006",
|
|
"default_key": "travel"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000007",
|
|
"default_key": "entertainment"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000008",
|
|
"default_key": "health"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000013",
|
|
"default_key": "children"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000009",
|
|
"default_key": "shopping"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000014",
|
|
"default_key": "fees"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-00000000000a",
|
|
"default_key": "other"
|
|
}
|
|
],
|
|
"fallback": "01920000-0000-7000-8000-00000000000a"
|
|
},
|
|
"expected": {
|
|
"ok": "01920000-0000-7000-8000-000000000011"
|
|
}
|
|
},
|
|
{
|
|
"name": "full table, cold start: lunch over ikea",
|
|
"input": {
|
|
"description": "Lunch på IKEA",
|
|
"history": [],
|
|
"keywords": [
|
|
{
|
|
"keyword": "barn",
|
|
"match": "prefix",
|
|
"default_key": "children"
|
|
},
|
|
{
|
|
"keyword": "blöjor",
|
|
"match": "token",
|
|
"default_key": "children"
|
|
},
|
|
{
|
|
"keyword": "fritids",
|
|
"match": "token",
|
|
"default_key": "children"
|
|
},
|
|
{
|
|
"keyword": "förskol",
|
|
"match": "prefix",
|
|
"default_key": "children"
|
|
},
|
|
{
|
|
"keyword": "leksak",
|
|
"match": "prefix",
|
|
"default_key": "children"
|
|
},
|
|
{
|
|
"keyword": "napp",
|
|
"match": "prefix",
|
|
"default_key": "children"
|
|
},
|
|
{
|
|
"keyword": "resevagn",
|
|
"match": "token",
|
|
"default_key": "children"
|
|
},
|
|
{
|
|
"keyword": "bio",
|
|
"match": "token",
|
|
"default_key": "entertainment"
|
|
},
|
|
{
|
|
"keyword": "entre",
|
|
"match": "token",
|
|
"default_key": "entertainment"
|
|
},
|
|
{
|
|
"keyword": "entré",
|
|
"match": "token",
|
|
"default_key": "entertainment"
|
|
},
|
|
{
|
|
"keyword": "filmstaden",
|
|
"match": "token",
|
|
"default_key": "entertainment"
|
|
},
|
|
{
|
|
"keyword": "karaoke",
|
|
"match": "token",
|
|
"default_key": "entertainment"
|
|
},
|
|
{
|
|
"keyword": "konsert",
|
|
"match": "prefix",
|
|
"default_key": "entertainment"
|
|
},
|
|
{
|
|
"keyword": "museet",
|
|
"match": "token",
|
|
"default_key": "entertainment"
|
|
},
|
|
{
|
|
"keyword": "museum",
|
|
"match": "token",
|
|
"default_key": "entertainment"
|
|
},
|
|
{
|
|
"keyword": "netflix",
|
|
"match": "token",
|
|
"default_key": "entertainment"
|
|
},
|
|
{
|
|
"keyword": "padel",
|
|
"match": "token",
|
|
"default_key": "entertainment"
|
|
},
|
|
{
|
|
"keyword": "spotify",
|
|
"match": "token",
|
|
"default_key": "entertainment"
|
|
},
|
|
{
|
|
"keyword": "teater",
|
|
"match": "prefix",
|
|
"default_key": "entertainment"
|
|
},
|
|
{
|
|
"keyword": "bankavgift",
|
|
"match": "token",
|
|
"default_key": "fees"
|
|
},
|
|
{
|
|
"keyword": "kvarskatt",
|
|
"match": "token",
|
|
"default_key": "fees"
|
|
},
|
|
{
|
|
"keyword": "ränteåterbäring",
|
|
"match": "token",
|
|
"default_key": "fees"
|
|
},
|
|
{
|
|
"keyword": "skatt",
|
|
"match": "token",
|
|
"default_key": "fees"
|
|
},
|
|
{
|
|
"keyword": "skatteverket",
|
|
"match": "token",
|
|
"default_key": "fees"
|
|
},
|
|
{
|
|
"keyword": "alkohol",
|
|
"match": "token",
|
|
"default_key": "groceries"
|
|
},
|
|
{
|
|
"keyword": "bondens marknad",
|
|
"match": "phrase",
|
|
"default_key": "groceries"
|
|
},
|
|
{
|
|
"keyword": "bröd",
|
|
"match": "token",
|
|
"default_key": "groceries"
|
|
},
|
|
{
|
|
"keyword": "bubbel",
|
|
"match": "token",
|
|
"default_key": "groceries"
|
|
},
|
|
{
|
|
"keyword": "city gross",
|
|
"match": "phrase",
|
|
"default_key": "groceries"
|
|
},
|
|
{
|
|
"keyword": "coop",
|
|
"match": "token",
|
|
"default_key": "groceries"
|
|
},
|
|
{
|
|
"keyword": "frukt",
|
|
"match": "token",
|
|
"default_key": "groceries"
|
|
},
|
|
{
|
|
"keyword": "grönsaker",
|
|
"match": "token",
|
|
"default_key": "groceries"
|
|
},
|
|
{
|
|
"keyword": "handling",
|
|
"match": "prefix",
|
|
"default_key": "groceries"
|
|
},
|
|
{
|
|
"keyword": "hemköp",
|
|
"match": "token",
|
|
"default_key": "groceries"
|
|
},
|
|
{
|
|
"keyword": "ica",
|
|
"match": "token",
|
|
"default_key": "groceries"
|
|
},
|
|
{
|
|
"keyword": "julmat",
|
|
"match": "token",
|
|
"default_key": "groceries"
|
|
},
|
|
{
|
|
"keyword": "lidl",
|
|
"match": "token",
|
|
"default_key": "groceries"
|
|
},
|
|
{
|
|
"keyword": "livs",
|
|
"match": "token",
|
|
"default_key": "groceries"
|
|
},
|
|
{
|
|
"keyword": "livsmedel",
|
|
"match": "prefix",
|
|
"default_key": "groceries"
|
|
},
|
|
{
|
|
"keyword": "mat",
|
|
"match": "token",
|
|
"default_key": "groceries"
|
|
},
|
|
{
|
|
"keyword": "mjölk",
|
|
"match": "token",
|
|
"default_key": "groceries"
|
|
},
|
|
{
|
|
"keyword": "netto",
|
|
"match": "token",
|
|
"default_key": "groceries"
|
|
},
|
|
{
|
|
"keyword": "ost",
|
|
"match": "token",
|
|
"default_key": "groceries"
|
|
},
|
|
{
|
|
"keyword": "snacks",
|
|
"match": "token",
|
|
"default_key": "groceries"
|
|
},
|
|
{
|
|
"keyword": "storhandling",
|
|
"match": "token",
|
|
"default_key": "groceries"
|
|
},
|
|
{
|
|
"keyword": "systembolag",
|
|
"match": "prefix",
|
|
"default_key": "groceries"
|
|
},
|
|
{
|
|
"keyword": "systemet",
|
|
"match": "token",
|
|
"default_key": "groceries"
|
|
},
|
|
{
|
|
"keyword": "willys",
|
|
"match": "token",
|
|
"default_key": "groceries"
|
|
},
|
|
{
|
|
"keyword": "apotek",
|
|
"match": "prefix",
|
|
"default_key": "health"
|
|
},
|
|
{
|
|
"keyword": "kry",
|
|
"match": "token",
|
|
"default_key": "health"
|
|
},
|
|
{
|
|
"keyword": "läkare",
|
|
"match": "token",
|
|
"default_key": "health"
|
|
},
|
|
{
|
|
"keyword": "medicin",
|
|
"match": "prefix",
|
|
"default_key": "health"
|
|
},
|
|
{
|
|
"keyword": "sjukhus",
|
|
"match": "token",
|
|
"default_key": "health"
|
|
},
|
|
{
|
|
"keyword": "tandläkare",
|
|
"match": "token",
|
|
"default_key": "health"
|
|
},
|
|
{
|
|
"keyword": "tandvård",
|
|
"match": "token",
|
|
"default_key": "health"
|
|
},
|
|
{
|
|
"keyword": "vårdcentral",
|
|
"match": "token",
|
|
"default_key": "health"
|
|
},
|
|
{
|
|
"keyword": "bauhaus",
|
|
"match": "token",
|
|
"default_key": "home"
|
|
},
|
|
{
|
|
"keyword": "byggmax",
|
|
"match": "token",
|
|
"default_key": "home"
|
|
},
|
|
{
|
|
"keyword": "clas ohlson",
|
|
"match": "phrase",
|
|
"default_key": "home"
|
|
},
|
|
{
|
|
"keyword": "elgiganten",
|
|
"match": "token",
|
|
"default_key": "home"
|
|
},
|
|
{
|
|
"keyword": "färg",
|
|
"match": "token",
|
|
"default_key": "home"
|
|
},
|
|
{
|
|
"keyword": "garderob",
|
|
"match": "prefix",
|
|
"default_key": "home"
|
|
},
|
|
{
|
|
"keyword": "gardin",
|
|
"match": "prefix",
|
|
"default_key": "home"
|
|
},
|
|
{
|
|
"keyword": "hylla",
|
|
"match": "token",
|
|
"default_key": "home"
|
|
},
|
|
{
|
|
"keyword": "ikea",
|
|
"match": "token",
|
|
"default_key": "home"
|
|
},
|
|
{
|
|
"keyword": "jysk",
|
|
"match": "token",
|
|
"default_key": "home"
|
|
},
|
|
{
|
|
"keyword": "lamp",
|
|
"match": "prefix",
|
|
"default_key": "home"
|
|
},
|
|
{
|
|
"keyword": "möbler",
|
|
"match": "token",
|
|
"default_key": "home"
|
|
},
|
|
{
|
|
"keyword": "ohlson",
|
|
"match": "token",
|
|
"default_key": "home"
|
|
},
|
|
{
|
|
"keyword": "rusta",
|
|
"match": "token",
|
|
"default_key": "home"
|
|
},
|
|
{
|
|
"keyword": "amortering",
|
|
"match": "prefix",
|
|
"default_key": "housing"
|
|
},
|
|
{
|
|
"keyword": "avgift",
|
|
"match": "token",
|
|
"default_key": "housing"
|
|
},
|
|
{
|
|
"keyword": "bolån",
|
|
"match": "token",
|
|
"default_key": "housing"
|
|
},
|
|
{
|
|
"keyword": "brf",
|
|
"match": "token",
|
|
"default_key": "housing"
|
|
},
|
|
{
|
|
"keyword": "hyra",
|
|
"match": "token",
|
|
"default_key": "housing"
|
|
},
|
|
{
|
|
"keyword": "lgh",
|
|
"match": "token",
|
|
"default_key": "housing"
|
|
},
|
|
{
|
|
"keyword": "ränta",
|
|
"match": "token",
|
|
"default_key": "housing"
|
|
},
|
|
{
|
|
"keyword": "barnförsäkring",
|
|
"match": "token",
|
|
"default_key": "insurance"
|
|
},
|
|
{
|
|
"keyword": "bilförsäkring",
|
|
"match": "token",
|
|
"default_key": "insurance"
|
|
},
|
|
{
|
|
"keyword": "folksam",
|
|
"match": "token",
|
|
"default_key": "insurance"
|
|
},
|
|
{
|
|
"keyword": "försäkring",
|
|
"match": "prefix",
|
|
"default_key": "insurance"
|
|
},
|
|
{
|
|
"keyword": "hemförsäkring",
|
|
"match": "token",
|
|
"default_key": "insurance"
|
|
},
|
|
{
|
|
"keyword": "länsförsäkringar",
|
|
"match": "token",
|
|
"default_key": "insurance"
|
|
},
|
|
{
|
|
"keyword": "trygg hansa",
|
|
"match": "phrase",
|
|
"default_key": "insurance"
|
|
},
|
|
{
|
|
"keyword": "bagel",
|
|
"match": "prefix",
|
|
"default_key": "restaurants"
|
|
},
|
|
{
|
|
"keyword": "bageri",
|
|
"match": "prefix",
|
|
"default_key": "restaurants"
|
|
},
|
|
{
|
|
"keyword": "bar",
|
|
"match": "token",
|
|
"default_key": "restaurants"
|
|
},
|
|
{
|
|
"keyword": "burger king",
|
|
"match": "phrase",
|
|
"default_key": "restaurants"
|
|
},
|
|
{
|
|
"keyword": "cafe",
|
|
"match": "token",
|
|
"default_key": "restaurants"
|
|
},
|
|
{
|
|
"keyword": "café",
|
|
"match": "token",
|
|
"default_key": "restaurants"
|
|
},
|
|
{
|
|
"keyword": "dumplings",
|
|
"match": "token",
|
|
"default_key": "restaurants"
|
|
},
|
|
{
|
|
"keyword": "fika",
|
|
"match": "prefix",
|
|
"default_key": "restaurants"
|
|
},
|
|
{
|
|
"keyword": "foodora",
|
|
"match": "token",
|
|
"default_key": "restaurants"
|
|
},
|
|
{
|
|
"keyword": "glass",
|
|
"match": "token",
|
|
"default_key": "restaurants"
|
|
},
|
|
{
|
|
"keyword": "hamburgare",
|
|
"match": "token",
|
|
"default_key": "restaurants"
|
|
},
|
|
{
|
|
"keyword": "kaffe",
|
|
"match": "token",
|
|
"default_key": "restaurants"
|
|
},
|
|
{
|
|
"keyword": "kebab",
|
|
"match": "token",
|
|
"default_key": "restaurants"
|
|
},
|
|
{
|
|
"keyword": "lunch",
|
|
"match": "token",
|
|
"default_key": "restaurants"
|
|
},
|
|
{
|
|
"keyword": "max",
|
|
"match": "token",
|
|
"default_key": "restaurants"
|
|
},
|
|
{
|
|
"keyword": "mcdonalds",
|
|
"match": "token",
|
|
"default_key": "restaurants"
|
|
},
|
|
{
|
|
"keyword": "middag",
|
|
"match": "token",
|
|
"default_key": "restaurants"
|
|
},
|
|
{
|
|
"keyword": "pizz",
|
|
"match": "prefix",
|
|
"default_key": "restaurants"
|
|
},
|
|
{
|
|
"keyword": "ramen",
|
|
"match": "token",
|
|
"default_key": "restaurants"
|
|
},
|
|
{
|
|
"keyword": "restaurang",
|
|
"match": "prefix",
|
|
"default_key": "restaurants"
|
|
},
|
|
{
|
|
"keyword": "seml",
|
|
"match": "prefix",
|
|
"default_key": "restaurants"
|
|
},
|
|
{
|
|
"keyword": "streetfood",
|
|
"match": "token",
|
|
"default_key": "restaurants"
|
|
},
|
|
{
|
|
"keyword": "sushi",
|
|
"match": "token",
|
|
"default_key": "restaurants"
|
|
},
|
|
{
|
|
"keyword": "thai",
|
|
"match": "token",
|
|
"default_key": "restaurants"
|
|
},
|
|
{
|
|
"keyword": "uber eats",
|
|
"match": "phrase",
|
|
"default_key": "restaurants"
|
|
},
|
|
{
|
|
"keyword": "amazon",
|
|
"match": "token",
|
|
"default_key": "shopping"
|
|
},
|
|
{
|
|
"keyword": "h&m",
|
|
"match": "token",
|
|
"default_key": "shopping"
|
|
},
|
|
{
|
|
"keyword": "kappahl",
|
|
"match": "token",
|
|
"default_key": "shopping"
|
|
},
|
|
{
|
|
"keyword": "lindex",
|
|
"match": "token",
|
|
"default_key": "shopping"
|
|
},
|
|
{
|
|
"keyword": "present",
|
|
"match": "prefix",
|
|
"default_key": "shopping"
|
|
},
|
|
{
|
|
"keyword": "skor",
|
|
"match": "token",
|
|
"default_key": "shopping"
|
|
},
|
|
{
|
|
"keyword": "stadium",
|
|
"match": "token",
|
|
"default_key": "shopping"
|
|
},
|
|
{
|
|
"keyword": "zalando",
|
|
"match": "token",
|
|
"default_key": "shopping"
|
|
},
|
|
{
|
|
"keyword": "bensin",
|
|
"match": "token",
|
|
"default_key": "transport"
|
|
},
|
|
{
|
|
"keyword": "bil",
|
|
"match": "token",
|
|
"default_key": "transport"
|
|
},
|
|
{
|
|
"keyword": "buss",
|
|
"match": "prefix",
|
|
"default_key": "transport"
|
|
},
|
|
{
|
|
"keyword": "flygbuss",
|
|
"match": "token",
|
|
"default_key": "transport"
|
|
},
|
|
{
|
|
"keyword": "färj",
|
|
"match": "prefix",
|
|
"default_key": "transport"
|
|
},
|
|
{
|
|
"keyword": "laddning",
|
|
"match": "prefix",
|
|
"default_key": "transport"
|
|
},
|
|
{
|
|
"keyword": "okq8",
|
|
"match": "token",
|
|
"default_key": "transport"
|
|
},
|
|
{
|
|
"keyword": "parkering",
|
|
"match": "prefix",
|
|
"default_key": "transport"
|
|
},
|
|
{
|
|
"keyword": "preem",
|
|
"match": "token",
|
|
"default_key": "transport"
|
|
},
|
|
{
|
|
"keyword": "sj",
|
|
"match": "token",
|
|
"default_key": "transport"
|
|
},
|
|
{
|
|
"keyword": "sl",
|
|
"match": "token",
|
|
"default_key": "transport"
|
|
},
|
|
{
|
|
"keyword": "tanka",
|
|
"match": "token",
|
|
"default_key": "transport"
|
|
},
|
|
{
|
|
"keyword": "taxi",
|
|
"match": "token",
|
|
"default_key": "transport"
|
|
},
|
|
{
|
|
"keyword": "trängselskatt",
|
|
"match": "token",
|
|
"default_key": "transport"
|
|
},
|
|
{
|
|
"keyword": "tåg",
|
|
"match": "token",
|
|
"default_key": "transport"
|
|
},
|
|
{
|
|
"keyword": "uber",
|
|
"match": "token",
|
|
"default_key": "transport"
|
|
},
|
|
{
|
|
"keyword": "airbnb",
|
|
"match": "token",
|
|
"default_key": "travel"
|
|
},
|
|
{
|
|
"keyword": "boende",
|
|
"match": "token",
|
|
"default_key": "travel"
|
|
},
|
|
{
|
|
"keyword": "booking",
|
|
"match": "token",
|
|
"default_key": "travel"
|
|
},
|
|
{
|
|
"keyword": "flyg",
|
|
"match": "token",
|
|
"default_key": "travel"
|
|
},
|
|
{
|
|
"keyword": "hotel",
|
|
"match": "token",
|
|
"default_key": "travel"
|
|
},
|
|
{
|
|
"keyword": "hotell",
|
|
"match": "token",
|
|
"default_key": "travel"
|
|
},
|
|
{
|
|
"keyword": "sas",
|
|
"match": "token",
|
|
"default_key": "travel"
|
|
},
|
|
{
|
|
"keyword": "bredband",
|
|
"match": "token",
|
|
"default_key": "utilities"
|
|
},
|
|
{
|
|
"keyword": "elräkning",
|
|
"match": "token",
|
|
"default_key": "utilities"
|
|
},
|
|
{
|
|
"keyword": "internet",
|
|
"match": "token",
|
|
"default_key": "utilities"
|
|
},
|
|
{
|
|
"keyword": "städning",
|
|
"match": "prefix",
|
|
"default_key": "utilities"
|
|
},
|
|
{
|
|
"keyword": "tele2",
|
|
"match": "token",
|
|
"default_key": "utilities"
|
|
},
|
|
{
|
|
"keyword": "telenor",
|
|
"match": "token",
|
|
"default_key": "utilities"
|
|
},
|
|
{
|
|
"keyword": "telia",
|
|
"match": "token",
|
|
"default_key": "utilities"
|
|
},
|
|
{
|
|
"keyword": "vattenfall",
|
|
"match": "token",
|
|
"default_key": "utilities"
|
|
}
|
|
],
|
|
"active_categories": [
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000001",
|
|
"default_key": "groceries"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000002",
|
|
"default_key": "restaurants"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000011",
|
|
"default_key": "housing"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000003",
|
|
"default_key": "home"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000004",
|
|
"default_key": "utilities"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000012",
|
|
"default_key": "insurance"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000005",
|
|
"default_key": "transport"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000006",
|
|
"default_key": "travel"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000007",
|
|
"default_key": "entertainment"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000008",
|
|
"default_key": "health"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000013",
|
|
"default_key": "children"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000009",
|
|
"default_key": "shopping"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000014",
|
|
"default_key": "fees"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-00000000000a",
|
|
"default_key": "other"
|
|
}
|
|
],
|
|
"fallback": "01920000-0000-7000-8000-00000000000a"
|
|
},
|
|
"expected": {
|
|
"ok": "01920000-0000-7000-8000-000000000002"
|
|
}
|
|
},
|
|
{
|
|
"name": "full table, cold start: systembolag prefix",
|
|
"input": {
|
|
"description": "Systembolaget",
|
|
"history": [],
|
|
"keywords": [
|
|
{
|
|
"keyword": "barn",
|
|
"match": "prefix",
|
|
"default_key": "children"
|
|
},
|
|
{
|
|
"keyword": "blöjor",
|
|
"match": "token",
|
|
"default_key": "children"
|
|
},
|
|
{
|
|
"keyword": "fritids",
|
|
"match": "token",
|
|
"default_key": "children"
|
|
},
|
|
{
|
|
"keyword": "förskol",
|
|
"match": "prefix",
|
|
"default_key": "children"
|
|
},
|
|
{
|
|
"keyword": "leksak",
|
|
"match": "prefix",
|
|
"default_key": "children"
|
|
},
|
|
{
|
|
"keyword": "napp",
|
|
"match": "prefix",
|
|
"default_key": "children"
|
|
},
|
|
{
|
|
"keyword": "resevagn",
|
|
"match": "token",
|
|
"default_key": "children"
|
|
},
|
|
{
|
|
"keyword": "bio",
|
|
"match": "token",
|
|
"default_key": "entertainment"
|
|
},
|
|
{
|
|
"keyword": "entre",
|
|
"match": "token",
|
|
"default_key": "entertainment"
|
|
},
|
|
{
|
|
"keyword": "entré",
|
|
"match": "token",
|
|
"default_key": "entertainment"
|
|
},
|
|
{
|
|
"keyword": "filmstaden",
|
|
"match": "token",
|
|
"default_key": "entertainment"
|
|
},
|
|
{
|
|
"keyword": "karaoke",
|
|
"match": "token",
|
|
"default_key": "entertainment"
|
|
},
|
|
{
|
|
"keyword": "konsert",
|
|
"match": "prefix",
|
|
"default_key": "entertainment"
|
|
},
|
|
{
|
|
"keyword": "museet",
|
|
"match": "token",
|
|
"default_key": "entertainment"
|
|
},
|
|
{
|
|
"keyword": "museum",
|
|
"match": "token",
|
|
"default_key": "entertainment"
|
|
},
|
|
{
|
|
"keyword": "netflix",
|
|
"match": "token",
|
|
"default_key": "entertainment"
|
|
},
|
|
{
|
|
"keyword": "padel",
|
|
"match": "token",
|
|
"default_key": "entertainment"
|
|
},
|
|
{
|
|
"keyword": "spotify",
|
|
"match": "token",
|
|
"default_key": "entertainment"
|
|
},
|
|
{
|
|
"keyword": "teater",
|
|
"match": "prefix",
|
|
"default_key": "entertainment"
|
|
},
|
|
{
|
|
"keyword": "bankavgift",
|
|
"match": "token",
|
|
"default_key": "fees"
|
|
},
|
|
{
|
|
"keyword": "kvarskatt",
|
|
"match": "token",
|
|
"default_key": "fees"
|
|
},
|
|
{
|
|
"keyword": "ränteåterbäring",
|
|
"match": "token",
|
|
"default_key": "fees"
|
|
},
|
|
{
|
|
"keyword": "skatt",
|
|
"match": "token",
|
|
"default_key": "fees"
|
|
},
|
|
{
|
|
"keyword": "skatteverket",
|
|
"match": "token",
|
|
"default_key": "fees"
|
|
},
|
|
{
|
|
"keyword": "alkohol",
|
|
"match": "token",
|
|
"default_key": "groceries"
|
|
},
|
|
{
|
|
"keyword": "bondens marknad",
|
|
"match": "phrase",
|
|
"default_key": "groceries"
|
|
},
|
|
{
|
|
"keyword": "bröd",
|
|
"match": "token",
|
|
"default_key": "groceries"
|
|
},
|
|
{
|
|
"keyword": "bubbel",
|
|
"match": "token",
|
|
"default_key": "groceries"
|
|
},
|
|
{
|
|
"keyword": "city gross",
|
|
"match": "phrase",
|
|
"default_key": "groceries"
|
|
},
|
|
{
|
|
"keyword": "coop",
|
|
"match": "token",
|
|
"default_key": "groceries"
|
|
},
|
|
{
|
|
"keyword": "frukt",
|
|
"match": "token",
|
|
"default_key": "groceries"
|
|
},
|
|
{
|
|
"keyword": "grönsaker",
|
|
"match": "token",
|
|
"default_key": "groceries"
|
|
},
|
|
{
|
|
"keyword": "handling",
|
|
"match": "prefix",
|
|
"default_key": "groceries"
|
|
},
|
|
{
|
|
"keyword": "hemköp",
|
|
"match": "token",
|
|
"default_key": "groceries"
|
|
},
|
|
{
|
|
"keyword": "ica",
|
|
"match": "token",
|
|
"default_key": "groceries"
|
|
},
|
|
{
|
|
"keyword": "julmat",
|
|
"match": "token",
|
|
"default_key": "groceries"
|
|
},
|
|
{
|
|
"keyword": "lidl",
|
|
"match": "token",
|
|
"default_key": "groceries"
|
|
},
|
|
{
|
|
"keyword": "livs",
|
|
"match": "token",
|
|
"default_key": "groceries"
|
|
},
|
|
{
|
|
"keyword": "livsmedel",
|
|
"match": "prefix",
|
|
"default_key": "groceries"
|
|
},
|
|
{
|
|
"keyword": "mat",
|
|
"match": "token",
|
|
"default_key": "groceries"
|
|
},
|
|
{
|
|
"keyword": "mjölk",
|
|
"match": "token",
|
|
"default_key": "groceries"
|
|
},
|
|
{
|
|
"keyword": "netto",
|
|
"match": "token",
|
|
"default_key": "groceries"
|
|
},
|
|
{
|
|
"keyword": "ost",
|
|
"match": "token",
|
|
"default_key": "groceries"
|
|
},
|
|
{
|
|
"keyword": "snacks",
|
|
"match": "token",
|
|
"default_key": "groceries"
|
|
},
|
|
{
|
|
"keyword": "storhandling",
|
|
"match": "token",
|
|
"default_key": "groceries"
|
|
},
|
|
{
|
|
"keyword": "systembolag",
|
|
"match": "prefix",
|
|
"default_key": "groceries"
|
|
},
|
|
{
|
|
"keyword": "systemet",
|
|
"match": "token",
|
|
"default_key": "groceries"
|
|
},
|
|
{
|
|
"keyword": "willys",
|
|
"match": "token",
|
|
"default_key": "groceries"
|
|
},
|
|
{
|
|
"keyword": "apotek",
|
|
"match": "prefix",
|
|
"default_key": "health"
|
|
},
|
|
{
|
|
"keyword": "kry",
|
|
"match": "token",
|
|
"default_key": "health"
|
|
},
|
|
{
|
|
"keyword": "läkare",
|
|
"match": "token",
|
|
"default_key": "health"
|
|
},
|
|
{
|
|
"keyword": "medicin",
|
|
"match": "prefix",
|
|
"default_key": "health"
|
|
},
|
|
{
|
|
"keyword": "sjukhus",
|
|
"match": "token",
|
|
"default_key": "health"
|
|
},
|
|
{
|
|
"keyword": "tandläkare",
|
|
"match": "token",
|
|
"default_key": "health"
|
|
},
|
|
{
|
|
"keyword": "tandvård",
|
|
"match": "token",
|
|
"default_key": "health"
|
|
},
|
|
{
|
|
"keyword": "vårdcentral",
|
|
"match": "token",
|
|
"default_key": "health"
|
|
},
|
|
{
|
|
"keyword": "bauhaus",
|
|
"match": "token",
|
|
"default_key": "home"
|
|
},
|
|
{
|
|
"keyword": "byggmax",
|
|
"match": "token",
|
|
"default_key": "home"
|
|
},
|
|
{
|
|
"keyword": "clas ohlson",
|
|
"match": "phrase",
|
|
"default_key": "home"
|
|
},
|
|
{
|
|
"keyword": "elgiganten",
|
|
"match": "token",
|
|
"default_key": "home"
|
|
},
|
|
{
|
|
"keyword": "färg",
|
|
"match": "token",
|
|
"default_key": "home"
|
|
},
|
|
{
|
|
"keyword": "garderob",
|
|
"match": "prefix",
|
|
"default_key": "home"
|
|
},
|
|
{
|
|
"keyword": "gardin",
|
|
"match": "prefix",
|
|
"default_key": "home"
|
|
},
|
|
{
|
|
"keyword": "hylla",
|
|
"match": "token",
|
|
"default_key": "home"
|
|
},
|
|
{
|
|
"keyword": "ikea",
|
|
"match": "token",
|
|
"default_key": "home"
|
|
},
|
|
{
|
|
"keyword": "jysk",
|
|
"match": "token",
|
|
"default_key": "home"
|
|
},
|
|
{
|
|
"keyword": "lamp",
|
|
"match": "prefix",
|
|
"default_key": "home"
|
|
},
|
|
{
|
|
"keyword": "möbler",
|
|
"match": "token",
|
|
"default_key": "home"
|
|
},
|
|
{
|
|
"keyword": "ohlson",
|
|
"match": "token",
|
|
"default_key": "home"
|
|
},
|
|
{
|
|
"keyword": "rusta",
|
|
"match": "token",
|
|
"default_key": "home"
|
|
},
|
|
{
|
|
"keyword": "amortering",
|
|
"match": "prefix",
|
|
"default_key": "housing"
|
|
},
|
|
{
|
|
"keyword": "avgift",
|
|
"match": "token",
|
|
"default_key": "housing"
|
|
},
|
|
{
|
|
"keyword": "bolån",
|
|
"match": "token",
|
|
"default_key": "housing"
|
|
},
|
|
{
|
|
"keyword": "brf",
|
|
"match": "token",
|
|
"default_key": "housing"
|
|
},
|
|
{
|
|
"keyword": "hyra",
|
|
"match": "token",
|
|
"default_key": "housing"
|
|
},
|
|
{
|
|
"keyword": "lgh",
|
|
"match": "token",
|
|
"default_key": "housing"
|
|
},
|
|
{
|
|
"keyword": "ränta",
|
|
"match": "token",
|
|
"default_key": "housing"
|
|
},
|
|
{
|
|
"keyword": "barnförsäkring",
|
|
"match": "token",
|
|
"default_key": "insurance"
|
|
},
|
|
{
|
|
"keyword": "bilförsäkring",
|
|
"match": "token",
|
|
"default_key": "insurance"
|
|
},
|
|
{
|
|
"keyword": "folksam",
|
|
"match": "token",
|
|
"default_key": "insurance"
|
|
},
|
|
{
|
|
"keyword": "försäkring",
|
|
"match": "prefix",
|
|
"default_key": "insurance"
|
|
},
|
|
{
|
|
"keyword": "hemförsäkring",
|
|
"match": "token",
|
|
"default_key": "insurance"
|
|
},
|
|
{
|
|
"keyword": "länsförsäkringar",
|
|
"match": "token",
|
|
"default_key": "insurance"
|
|
},
|
|
{
|
|
"keyword": "trygg hansa",
|
|
"match": "phrase",
|
|
"default_key": "insurance"
|
|
},
|
|
{
|
|
"keyword": "bagel",
|
|
"match": "prefix",
|
|
"default_key": "restaurants"
|
|
},
|
|
{
|
|
"keyword": "bageri",
|
|
"match": "prefix",
|
|
"default_key": "restaurants"
|
|
},
|
|
{
|
|
"keyword": "bar",
|
|
"match": "token",
|
|
"default_key": "restaurants"
|
|
},
|
|
{
|
|
"keyword": "burger king",
|
|
"match": "phrase",
|
|
"default_key": "restaurants"
|
|
},
|
|
{
|
|
"keyword": "cafe",
|
|
"match": "token",
|
|
"default_key": "restaurants"
|
|
},
|
|
{
|
|
"keyword": "café",
|
|
"match": "token",
|
|
"default_key": "restaurants"
|
|
},
|
|
{
|
|
"keyword": "dumplings",
|
|
"match": "token",
|
|
"default_key": "restaurants"
|
|
},
|
|
{
|
|
"keyword": "fika",
|
|
"match": "prefix",
|
|
"default_key": "restaurants"
|
|
},
|
|
{
|
|
"keyword": "foodora",
|
|
"match": "token",
|
|
"default_key": "restaurants"
|
|
},
|
|
{
|
|
"keyword": "glass",
|
|
"match": "token",
|
|
"default_key": "restaurants"
|
|
},
|
|
{
|
|
"keyword": "hamburgare",
|
|
"match": "token",
|
|
"default_key": "restaurants"
|
|
},
|
|
{
|
|
"keyword": "kaffe",
|
|
"match": "token",
|
|
"default_key": "restaurants"
|
|
},
|
|
{
|
|
"keyword": "kebab",
|
|
"match": "token",
|
|
"default_key": "restaurants"
|
|
},
|
|
{
|
|
"keyword": "lunch",
|
|
"match": "token",
|
|
"default_key": "restaurants"
|
|
},
|
|
{
|
|
"keyword": "max",
|
|
"match": "token",
|
|
"default_key": "restaurants"
|
|
},
|
|
{
|
|
"keyword": "mcdonalds",
|
|
"match": "token",
|
|
"default_key": "restaurants"
|
|
},
|
|
{
|
|
"keyword": "middag",
|
|
"match": "token",
|
|
"default_key": "restaurants"
|
|
},
|
|
{
|
|
"keyword": "pizz",
|
|
"match": "prefix",
|
|
"default_key": "restaurants"
|
|
},
|
|
{
|
|
"keyword": "ramen",
|
|
"match": "token",
|
|
"default_key": "restaurants"
|
|
},
|
|
{
|
|
"keyword": "restaurang",
|
|
"match": "prefix",
|
|
"default_key": "restaurants"
|
|
},
|
|
{
|
|
"keyword": "seml",
|
|
"match": "prefix",
|
|
"default_key": "restaurants"
|
|
},
|
|
{
|
|
"keyword": "streetfood",
|
|
"match": "token",
|
|
"default_key": "restaurants"
|
|
},
|
|
{
|
|
"keyword": "sushi",
|
|
"match": "token",
|
|
"default_key": "restaurants"
|
|
},
|
|
{
|
|
"keyword": "thai",
|
|
"match": "token",
|
|
"default_key": "restaurants"
|
|
},
|
|
{
|
|
"keyword": "uber eats",
|
|
"match": "phrase",
|
|
"default_key": "restaurants"
|
|
},
|
|
{
|
|
"keyword": "amazon",
|
|
"match": "token",
|
|
"default_key": "shopping"
|
|
},
|
|
{
|
|
"keyword": "h&m",
|
|
"match": "token",
|
|
"default_key": "shopping"
|
|
},
|
|
{
|
|
"keyword": "kappahl",
|
|
"match": "token",
|
|
"default_key": "shopping"
|
|
},
|
|
{
|
|
"keyword": "lindex",
|
|
"match": "token",
|
|
"default_key": "shopping"
|
|
},
|
|
{
|
|
"keyword": "present",
|
|
"match": "prefix",
|
|
"default_key": "shopping"
|
|
},
|
|
{
|
|
"keyword": "skor",
|
|
"match": "token",
|
|
"default_key": "shopping"
|
|
},
|
|
{
|
|
"keyword": "stadium",
|
|
"match": "token",
|
|
"default_key": "shopping"
|
|
},
|
|
{
|
|
"keyword": "zalando",
|
|
"match": "token",
|
|
"default_key": "shopping"
|
|
},
|
|
{
|
|
"keyword": "bensin",
|
|
"match": "token",
|
|
"default_key": "transport"
|
|
},
|
|
{
|
|
"keyword": "bil",
|
|
"match": "token",
|
|
"default_key": "transport"
|
|
},
|
|
{
|
|
"keyword": "buss",
|
|
"match": "prefix",
|
|
"default_key": "transport"
|
|
},
|
|
{
|
|
"keyword": "flygbuss",
|
|
"match": "token",
|
|
"default_key": "transport"
|
|
},
|
|
{
|
|
"keyword": "färj",
|
|
"match": "prefix",
|
|
"default_key": "transport"
|
|
},
|
|
{
|
|
"keyword": "laddning",
|
|
"match": "prefix",
|
|
"default_key": "transport"
|
|
},
|
|
{
|
|
"keyword": "okq8",
|
|
"match": "token",
|
|
"default_key": "transport"
|
|
},
|
|
{
|
|
"keyword": "parkering",
|
|
"match": "prefix",
|
|
"default_key": "transport"
|
|
},
|
|
{
|
|
"keyword": "preem",
|
|
"match": "token",
|
|
"default_key": "transport"
|
|
},
|
|
{
|
|
"keyword": "sj",
|
|
"match": "token",
|
|
"default_key": "transport"
|
|
},
|
|
{
|
|
"keyword": "sl",
|
|
"match": "token",
|
|
"default_key": "transport"
|
|
},
|
|
{
|
|
"keyword": "tanka",
|
|
"match": "token",
|
|
"default_key": "transport"
|
|
},
|
|
{
|
|
"keyword": "taxi",
|
|
"match": "token",
|
|
"default_key": "transport"
|
|
},
|
|
{
|
|
"keyword": "trängselskatt",
|
|
"match": "token",
|
|
"default_key": "transport"
|
|
},
|
|
{
|
|
"keyword": "tåg",
|
|
"match": "token",
|
|
"default_key": "transport"
|
|
},
|
|
{
|
|
"keyword": "uber",
|
|
"match": "token",
|
|
"default_key": "transport"
|
|
},
|
|
{
|
|
"keyword": "airbnb",
|
|
"match": "token",
|
|
"default_key": "travel"
|
|
},
|
|
{
|
|
"keyword": "boende",
|
|
"match": "token",
|
|
"default_key": "travel"
|
|
},
|
|
{
|
|
"keyword": "booking",
|
|
"match": "token",
|
|
"default_key": "travel"
|
|
},
|
|
{
|
|
"keyword": "flyg",
|
|
"match": "token",
|
|
"default_key": "travel"
|
|
},
|
|
{
|
|
"keyword": "hotel",
|
|
"match": "token",
|
|
"default_key": "travel"
|
|
},
|
|
{
|
|
"keyword": "hotell",
|
|
"match": "token",
|
|
"default_key": "travel"
|
|
},
|
|
{
|
|
"keyword": "sas",
|
|
"match": "token",
|
|
"default_key": "travel"
|
|
},
|
|
{
|
|
"keyword": "bredband",
|
|
"match": "token",
|
|
"default_key": "utilities"
|
|
},
|
|
{
|
|
"keyword": "elräkning",
|
|
"match": "token",
|
|
"default_key": "utilities"
|
|
},
|
|
{
|
|
"keyword": "internet",
|
|
"match": "token",
|
|
"default_key": "utilities"
|
|
},
|
|
{
|
|
"keyword": "städning",
|
|
"match": "prefix",
|
|
"default_key": "utilities"
|
|
},
|
|
{
|
|
"keyword": "tele2",
|
|
"match": "token",
|
|
"default_key": "utilities"
|
|
},
|
|
{
|
|
"keyword": "telenor",
|
|
"match": "token",
|
|
"default_key": "utilities"
|
|
},
|
|
{
|
|
"keyword": "telia",
|
|
"match": "token",
|
|
"default_key": "utilities"
|
|
},
|
|
{
|
|
"keyword": "vattenfall",
|
|
"match": "token",
|
|
"default_key": "utilities"
|
|
}
|
|
],
|
|
"active_categories": [
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000001",
|
|
"default_key": "groceries"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000002",
|
|
"default_key": "restaurants"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000011",
|
|
"default_key": "housing"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000003",
|
|
"default_key": "home"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000004",
|
|
"default_key": "utilities"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000012",
|
|
"default_key": "insurance"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000005",
|
|
"default_key": "transport"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000006",
|
|
"default_key": "travel"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000007",
|
|
"default_key": "entertainment"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000008",
|
|
"default_key": "health"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000013",
|
|
"default_key": "children"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000009",
|
|
"default_key": "shopping"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000014",
|
|
"default_key": "fees"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-00000000000a",
|
|
"default_key": "other"
|
|
}
|
|
],
|
|
"fallback": "01920000-0000-7000-8000-00000000000a"
|
|
},
|
|
"expected": {
|
|
"ok": "01920000-0000-7000-8000-000000000001"
|
|
}
|
|
},
|
|
{
|
|
"name": "full table, cold start: hemförsäkring over trygg hansa",
|
|
"input": {
|
|
"description": "Trygg-Hansa hemförsäkring",
|
|
"history": [],
|
|
"keywords": [
|
|
{
|
|
"keyword": "barn",
|
|
"match": "prefix",
|
|
"default_key": "children"
|
|
},
|
|
{
|
|
"keyword": "blöjor",
|
|
"match": "token",
|
|
"default_key": "children"
|
|
},
|
|
{
|
|
"keyword": "fritids",
|
|
"match": "token",
|
|
"default_key": "children"
|
|
},
|
|
{
|
|
"keyword": "förskol",
|
|
"match": "prefix",
|
|
"default_key": "children"
|
|
},
|
|
{
|
|
"keyword": "leksak",
|
|
"match": "prefix",
|
|
"default_key": "children"
|
|
},
|
|
{
|
|
"keyword": "napp",
|
|
"match": "prefix",
|
|
"default_key": "children"
|
|
},
|
|
{
|
|
"keyword": "resevagn",
|
|
"match": "token",
|
|
"default_key": "children"
|
|
},
|
|
{
|
|
"keyword": "bio",
|
|
"match": "token",
|
|
"default_key": "entertainment"
|
|
},
|
|
{
|
|
"keyword": "entre",
|
|
"match": "token",
|
|
"default_key": "entertainment"
|
|
},
|
|
{
|
|
"keyword": "entré",
|
|
"match": "token",
|
|
"default_key": "entertainment"
|
|
},
|
|
{
|
|
"keyword": "filmstaden",
|
|
"match": "token",
|
|
"default_key": "entertainment"
|
|
},
|
|
{
|
|
"keyword": "karaoke",
|
|
"match": "token",
|
|
"default_key": "entertainment"
|
|
},
|
|
{
|
|
"keyword": "konsert",
|
|
"match": "prefix",
|
|
"default_key": "entertainment"
|
|
},
|
|
{
|
|
"keyword": "museet",
|
|
"match": "token",
|
|
"default_key": "entertainment"
|
|
},
|
|
{
|
|
"keyword": "museum",
|
|
"match": "token",
|
|
"default_key": "entertainment"
|
|
},
|
|
{
|
|
"keyword": "netflix",
|
|
"match": "token",
|
|
"default_key": "entertainment"
|
|
},
|
|
{
|
|
"keyword": "padel",
|
|
"match": "token",
|
|
"default_key": "entertainment"
|
|
},
|
|
{
|
|
"keyword": "spotify",
|
|
"match": "token",
|
|
"default_key": "entertainment"
|
|
},
|
|
{
|
|
"keyword": "teater",
|
|
"match": "prefix",
|
|
"default_key": "entertainment"
|
|
},
|
|
{
|
|
"keyword": "bankavgift",
|
|
"match": "token",
|
|
"default_key": "fees"
|
|
},
|
|
{
|
|
"keyword": "kvarskatt",
|
|
"match": "token",
|
|
"default_key": "fees"
|
|
},
|
|
{
|
|
"keyword": "ränteåterbäring",
|
|
"match": "token",
|
|
"default_key": "fees"
|
|
},
|
|
{
|
|
"keyword": "skatt",
|
|
"match": "token",
|
|
"default_key": "fees"
|
|
},
|
|
{
|
|
"keyword": "skatteverket",
|
|
"match": "token",
|
|
"default_key": "fees"
|
|
},
|
|
{
|
|
"keyword": "alkohol",
|
|
"match": "token",
|
|
"default_key": "groceries"
|
|
},
|
|
{
|
|
"keyword": "bondens marknad",
|
|
"match": "phrase",
|
|
"default_key": "groceries"
|
|
},
|
|
{
|
|
"keyword": "bröd",
|
|
"match": "token",
|
|
"default_key": "groceries"
|
|
},
|
|
{
|
|
"keyword": "bubbel",
|
|
"match": "token",
|
|
"default_key": "groceries"
|
|
},
|
|
{
|
|
"keyword": "city gross",
|
|
"match": "phrase",
|
|
"default_key": "groceries"
|
|
},
|
|
{
|
|
"keyword": "coop",
|
|
"match": "token",
|
|
"default_key": "groceries"
|
|
},
|
|
{
|
|
"keyword": "frukt",
|
|
"match": "token",
|
|
"default_key": "groceries"
|
|
},
|
|
{
|
|
"keyword": "grönsaker",
|
|
"match": "token",
|
|
"default_key": "groceries"
|
|
},
|
|
{
|
|
"keyword": "handling",
|
|
"match": "prefix",
|
|
"default_key": "groceries"
|
|
},
|
|
{
|
|
"keyword": "hemköp",
|
|
"match": "token",
|
|
"default_key": "groceries"
|
|
},
|
|
{
|
|
"keyword": "ica",
|
|
"match": "token",
|
|
"default_key": "groceries"
|
|
},
|
|
{
|
|
"keyword": "julmat",
|
|
"match": "token",
|
|
"default_key": "groceries"
|
|
},
|
|
{
|
|
"keyword": "lidl",
|
|
"match": "token",
|
|
"default_key": "groceries"
|
|
},
|
|
{
|
|
"keyword": "livs",
|
|
"match": "token",
|
|
"default_key": "groceries"
|
|
},
|
|
{
|
|
"keyword": "livsmedel",
|
|
"match": "prefix",
|
|
"default_key": "groceries"
|
|
},
|
|
{
|
|
"keyword": "mat",
|
|
"match": "token",
|
|
"default_key": "groceries"
|
|
},
|
|
{
|
|
"keyword": "mjölk",
|
|
"match": "token",
|
|
"default_key": "groceries"
|
|
},
|
|
{
|
|
"keyword": "netto",
|
|
"match": "token",
|
|
"default_key": "groceries"
|
|
},
|
|
{
|
|
"keyword": "ost",
|
|
"match": "token",
|
|
"default_key": "groceries"
|
|
},
|
|
{
|
|
"keyword": "snacks",
|
|
"match": "token",
|
|
"default_key": "groceries"
|
|
},
|
|
{
|
|
"keyword": "storhandling",
|
|
"match": "token",
|
|
"default_key": "groceries"
|
|
},
|
|
{
|
|
"keyword": "systembolag",
|
|
"match": "prefix",
|
|
"default_key": "groceries"
|
|
},
|
|
{
|
|
"keyword": "systemet",
|
|
"match": "token",
|
|
"default_key": "groceries"
|
|
},
|
|
{
|
|
"keyword": "willys",
|
|
"match": "token",
|
|
"default_key": "groceries"
|
|
},
|
|
{
|
|
"keyword": "apotek",
|
|
"match": "prefix",
|
|
"default_key": "health"
|
|
},
|
|
{
|
|
"keyword": "kry",
|
|
"match": "token",
|
|
"default_key": "health"
|
|
},
|
|
{
|
|
"keyword": "läkare",
|
|
"match": "token",
|
|
"default_key": "health"
|
|
},
|
|
{
|
|
"keyword": "medicin",
|
|
"match": "prefix",
|
|
"default_key": "health"
|
|
},
|
|
{
|
|
"keyword": "sjukhus",
|
|
"match": "token",
|
|
"default_key": "health"
|
|
},
|
|
{
|
|
"keyword": "tandläkare",
|
|
"match": "token",
|
|
"default_key": "health"
|
|
},
|
|
{
|
|
"keyword": "tandvård",
|
|
"match": "token",
|
|
"default_key": "health"
|
|
},
|
|
{
|
|
"keyword": "vårdcentral",
|
|
"match": "token",
|
|
"default_key": "health"
|
|
},
|
|
{
|
|
"keyword": "bauhaus",
|
|
"match": "token",
|
|
"default_key": "home"
|
|
},
|
|
{
|
|
"keyword": "byggmax",
|
|
"match": "token",
|
|
"default_key": "home"
|
|
},
|
|
{
|
|
"keyword": "clas ohlson",
|
|
"match": "phrase",
|
|
"default_key": "home"
|
|
},
|
|
{
|
|
"keyword": "elgiganten",
|
|
"match": "token",
|
|
"default_key": "home"
|
|
},
|
|
{
|
|
"keyword": "färg",
|
|
"match": "token",
|
|
"default_key": "home"
|
|
},
|
|
{
|
|
"keyword": "garderob",
|
|
"match": "prefix",
|
|
"default_key": "home"
|
|
},
|
|
{
|
|
"keyword": "gardin",
|
|
"match": "prefix",
|
|
"default_key": "home"
|
|
},
|
|
{
|
|
"keyword": "hylla",
|
|
"match": "token",
|
|
"default_key": "home"
|
|
},
|
|
{
|
|
"keyword": "ikea",
|
|
"match": "token",
|
|
"default_key": "home"
|
|
},
|
|
{
|
|
"keyword": "jysk",
|
|
"match": "token",
|
|
"default_key": "home"
|
|
},
|
|
{
|
|
"keyword": "lamp",
|
|
"match": "prefix",
|
|
"default_key": "home"
|
|
},
|
|
{
|
|
"keyword": "möbler",
|
|
"match": "token",
|
|
"default_key": "home"
|
|
},
|
|
{
|
|
"keyword": "ohlson",
|
|
"match": "token",
|
|
"default_key": "home"
|
|
},
|
|
{
|
|
"keyword": "rusta",
|
|
"match": "token",
|
|
"default_key": "home"
|
|
},
|
|
{
|
|
"keyword": "amortering",
|
|
"match": "prefix",
|
|
"default_key": "housing"
|
|
},
|
|
{
|
|
"keyword": "avgift",
|
|
"match": "token",
|
|
"default_key": "housing"
|
|
},
|
|
{
|
|
"keyword": "bolån",
|
|
"match": "token",
|
|
"default_key": "housing"
|
|
},
|
|
{
|
|
"keyword": "brf",
|
|
"match": "token",
|
|
"default_key": "housing"
|
|
},
|
|
{
|
|
"keyword": "hyra",
|
|
"match": "token",
|
|
"default_key": "housing"
|
|
},
|
|
{
|
|
"keyword": "lgh",
|
|
"match": "token",
|
|
"default_key": "housing"
|
|
},
|
|
{
|
|
"keyword": "ränta",
|
|
"match": "token",
|
|
"default_key": "housing"
|
|
},
|
|
{
|
|
"keyword": "barnförsäkring",
|
|
"match": "token",
|
|
"default_key": "insurance"
|
|
},
|
|
{
|
|
"keyword": "bilförsäkring",
|
|
"match": "token",
|
|
"default_key": "insurance"
|
|
},
|
|
{
|
|
"keyword": "folksam",
|
|
"match": "token",
|
|
"default_key": "insurance"
|
|
},
|
|
{
|
|
"keyword": "försäkring",
|
|
"match": "prefix",
|
|
"default_key": "insurance"
|
|
},
|
|
{
|
|
"keyword": "hemförsäkring",
|
|
"match": "token",
|
|
"default_key": "insurance"
|
|
},
|
|
{
|
|
"keyword": "länsförsäkringar",
|
|
"match": "token",
|
|
"default_key": "insurance"
|
|
},
|
|
{
|
|
"keyword": "trygg hansa",
|
|
"match": "phrase",
|
|
"default_key": "insurance"
|
|
},
|
|
{
|
|
"keyword": "bagel",
|
|
"match": "prefix",
|
|
"default_key": "restaurants"
|
|
},
|
|
{
|
|
"keyword": "bageri",
|
|
"match": "prefix",
|
|
"default_key": "restaurants"
|
|
},
|
|
{
|
|
"keyword": "bar",
|
|
"match": "token",
|
|
"default_key": "restaurants"
|
|
},
|
|
{
|
|
"keyword": "burger king",
|
|
"match": "phrase",
|
|
"default_key": "restaurants"
|
|
},
|
|
{
|
|
"keyword": "cafe",
|
|
"match": "token",
|
|
"default_key": "restaurants"
|
|
},
|
|
{
|
|
"keyword": "café",
|
|
"match": "token",
|
|
"default_key": "restaurants"
|
|
},
|
|
{
|
|
"keyword": "dumplings",
|
|
"match": "token",
|
|
"default_key": "restaurants"
|
|
},
|
|
{
|
|
"keyword": "fika",
|
|
"match": "prefix",
|
|
"default_key": "restaurants"
|
|
},
|
|
{
|
|
"keyword": "foodora",
|
|
"match": "token",
|
|
"default_key": "restaurants"
|
|
},
|
|
{
|
|
"keyword": "glass",
|
|
"match": "token",
|
|
"default_key": "restaurants"
|
|
},
|
|
{
|
|
"keyword": "hamburgare",
|
|
"match": "token",
|
|
"default_key": "restaurants"
|
|
},
|
|
{
|
|
"keyword": "kaffe",
|
|
"match": "token",
|
|
"default_key": "restaurants"
|
|
},
|
|
{
|
|
"keyword": "kebab",
|
|
"match": "token",
|
|
"default_key": "restaurants"
|
|
},
|
|
{
|
|
"keyword": "lunch",
|
|
"match": "token",
|
|
"default_key": "restaurants"
|
|
},
|
|
{
|
|
"keyword": "max",
|
|
"match": "token",
|
|
"default_key": "restaurants"
|
|
},
|
|
{
|
|
"keyword": "mcdonalds",
|
|
"match": "token",
|
|
"default_key": "restaurants"
|
|
},
|
|
{
|
|
"keyword": "middag",
|
|
"match": "token",
|
|
"default_key": "restaurants"
|
|
},
|
|
{
|
|
"keyword": "pizz",
|
|
"match": "prefix",
|
|
"default_key": "restaurants"
|
|
},
|
|
{
|
|
"keyword": "ramen",
|
|
"match": "token",
|
|
"default_key": "restaurants"
|
|
},
|
|
{
|
|
"keyword": "restaurang",
|
|
"match": "prefix",
|
|
"default_key": "restaurants"
|
|
},
|
|
{
|
|
"keyword": "seml",
|
|
"match": "prefix",
|
|
"default_key": "restaurants"
|
|
},
|
|
{
|
|
"keyword": "streetfood",
|
|
"match": "token",
|
|
"default_key": "restaurants"
|
|
},
|
|
{
|
|
"keyword": "sushi",
|
|
"match": "token",
|
|
"default_key": "restaurants"
|
|
},
|
|
{
|
|
"keyword": "thai",
|
|
"match": "token",
|
|
"default_key": "restaurants"
|
|
},
|
|
{
|
|
"keyword": "uber eats",
|
|
"match": "phrase",
|
|
"default_key": "restaurants"
|
|
},
|
|
{
|
|
"keyword": "amazon",
|
|
"match": "token",
|
|
"default_key": "shopping"
|
|
},
|
|
{
|
|
"keyword": "h&m",
|
|
"match": "token",
|
|
"default_key": "shopping"
|
|
},
|
|
{
|
|
"keyword": "kappahl",
|
|
"match": "token",
|
|
"default_key": "shopping"
|
|
},
|
|
{
|
|
"keyword": "lindex",
|
|
"match": "token",
|
|
"default_key": "shopping"
|
|
},
|
|
{
|
|
"keyword": "present",
|
|
"match": "prefix",
|
|
"default_key": "shopping"
|
|
},
|
|
{
|
|
"keyword": "skor",
|
|
"match": "token",
|
|
"default_key": "shopping"
|
|
},
|
|
{
|
|
"keyword": "stadium",
|
|
"match": "token",
|
|
"default_key": "shopping"
|
|
},
|
|
{
|
|
"keyword": "zalando",
|
|
"match": "token",
|
|
"default_key": "shopping"
|
|
},
|
|
{
|
|
"keyword": "bensin",
|
|
"match": "token",
|
|
"default_key": "transport"
|
|
},
|
|
{
|
|
"keyword": "bil",
|
|
"match": "token",
|
|
"default_key": "transport"
|
|
},
|
|
{
|
|
"keyword": "buss",
|
|
"match": "prefix",
|
|
"default_key": "transport"
|
|
},
|
|
{
|
|
"keyword": "flygbuss",
|
|
"match": "token",
|
|
"default_key": "transport"
|
|
},
|
|
{
|
|
"keyword": "färj",
|
|
"match": "prefix",
|
|
"default_key": "transport"
|
|
},
|
|
{
|
|
"keyword": "laddning",
|
|
"match": "prefix",
|
|
"default_key": "transport"
|
|
},
|
|
{
|
|
"keyword": "okq8",
|
|
"match": "token",
|
|
"default_key": "transport"
|
|
},
|
|
{
|
|
"keyword": "parkering",
|
|
"match": "prefix",
|
|
"default_key": "transport"
|
|
},
|
|
{
|
|
"keyword": "preem",
|
|
"match": "token",
|
|
"default_key": "transport"
|
|
},
|
|
{
|
|
"keyword": "sj",
|
|
"match": "token",
|
|
"default_key": "transport"
|
|
},
|
|
{
|
|
"keyword": "sl",
|
|
"match": "token",
|
|
"default_key": "transport"
|
|
},
|
|
{
|
|
"keyword": "tanka",
|
|
"match": "token",
|
|
"default_key": "transport"
|
|
},
|
|
{
|
|
"keyword": "taxi",
|
|
"match": "token",
|
|
"default_key": "transport"
|
|
},
|
|
{
|
|
"keyword": "trängselskatt",
|
|
"match": "token",
|
|
"default_key": "transport"
|
|
},
|
|
{
|
|
"keyword": "tåg",
|
|
"match": "token",
|
|
"default_key": "transport"
|
|
},
|
|
{
|
|
"keyword": "uber",
|
|
"match": "token",
|
|
"default_key": "transport"
|
|
},
|
|
{
|
|
"keyword": "airbnb",
|
|
"match": "token",
|
|
"default_key": "travel"
|
|
},
|
|
{
|
|
"keyword": "boende",
|
|
"match": "token",
|
|
"default_key": "travel"
|
|
},
|
|
{
|
|
"keyword": "booking",
|
|
"match": "token",
|
|
"default_key": "travel"
|
|
},
|
|
{
|
|
"keyword": "flyg",
|
|
"match": "token",
|
|
"default_key": "travel"
|
|
},
|
|
{
|
|
"keyword": "hotel",
|
|
"match": "token",
|
|
"default_key": "travel"
|
|
},
|
|
{
|
|
"keyword": "hotell",
|
|
"match": "token",
|
|
"default_key": "travel"
|
|
},
|
|
{
|
|
"keyword": "sas",
|
|
"match": "token",
|
|
"default_key": "travel"
|
|
},
|
|
{
|
|
"keyword": "bredband",
|
|
"match": "token",
|
|
"default_key": "utilities"
|
|
},
|
|
{
|
|
"keyword": "elräkning",
|
|
"match": "token",
|
|
"default_key": "utilities"
|
|
},
|
|
{
|
|
"keyword": "internet",
|
|
"match": "token",
|
|
"default_key": "utilities"
|
|
},
|
|
{
|
|
"keyword": "städning",
|
|
"match": "prefix",
|
|
"default_key": "utilities"
|
|
},
|
|
{
|
|
"keyword": "tele2",
|
|
"match": "token",
|
|
"default_key": "utilities"
|
|
},
|
|
{
|
|
"keyword": "telenor",
|
|
"match": "token",
|
|
"default_key": "utilities"
|
|
},
|
|
{
|
|
"keyword": "telia",
|
|
"match": "token",
|
|
"default_key": "utilities"
|
|
},
|
|
{
|
|
"keyword": "vattenfall",
|
|
"match": "token",
|
|
"default_key": "utilities"
|
|
}
|
|
],
|
|
"active_categories": [
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000001",
|
|
"default_key": "groceries"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000002",
|
|
"default_key": "restaurants"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000011",
|
|
"default_key": "housing"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000003",
|
|
"default_key": "home"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000004",
|
|
"default_key": "utilities"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000012",
|
|
"default_key": "insurance"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000005",
|
|
"default_key": "transport"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000006",
|
|
"default_key": "travel"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000007",
|
|
"default_key": "entertainment"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000008",
|
|
"default_key": "health"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000013",
|
|
"default_key": "children"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000009",
|
|
"default_key": "shopping"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000014",
|
|
"default_key": "fees"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-00000000000a",
|
|
"default_key": "other"
|
|
}
|
|
],
|
|
"fallback": "01920000-0000-7000-8000-00000000000a"
|
|
},
|
|
"expected": {
|
|
"ok": "01920000-0000-7000-8000-000000000012"
|
|
}
|
|
},
|
|
{
|
|
"name": "fallback when nothing matches",
|
|
"input": {
|
|
"description": "Diverse",
|
|
"history": [
|
|
{
|
|
"description": "Ica",
|
|
"category_id": "01920000-0000-7000-8000-000000000001",
|
|
"expense_date": "2026-10-01",
|
|
"created_at": "2026-10-01T12:00:00.000Z"
|
|
}
|
|
],
|
|
"keywords": [
|
|
{
|
|
"keyword": "ica",
|
|
"match": "token",
|
|
"default_key": "groceries"
|
|
}
|
|
],
|
|
"active_categories": [
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000001",
|
|
"default_key": "groceries"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000002",
|
|
"default_key": "restaurants"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000011",
|
|
"default_key": "housing"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000003",
|
|
"default_key": "home"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000004",
|
|
"default_key": "utilities"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000012",
|
|
"default_key": "insurance"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000005",
|
|
"default_key": "transport"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000006",
|
|
"default_key": "travel"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000007",
|
|
"default_key": "entertainment"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000008",
|
|
"default_key": "health"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000013",
|
|
"default_key": "children"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000009",
|
|
"default_key": "shopping"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000014",
|
|
"default_key": "fees"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-00000000000a",
|
|
"default_key": "other"
|
|
}
|
|
],
|
|
"fallback": "01920000-0000-7000-8000-000000000003"
|
|
},
|
|
"expected": {
|
|
"ok": "01920000-0000-7000-8000-000000000003"
|
|
}
|
|
},
|
|
{
|
|
"name": "null fallback when nothing matches",
|
|
"input": {
|
|
"description": "Diverse",
|
|
"history": [
|
|
{
|
|
"description": "Ica",
|
|
"category_id": "01920000-0000-7000-8000-000000000001",
|
|
"expense_date": "2026-10-01",
|
|
"created_at": "2026-10-01T12:00:00.000Z"
|
|
}
|
|
],
|
|
"keywords": [
|
|
{
|
|
"keyword": "ica",
|
|
"match": "token",
|
|
"default_key": "groceries"
|
|
}
|
|
],
|
|
"active_categories": [
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000001",
|
|
"default_key": "groceries"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000002",
|
|
"default_key": "restaurants"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000011",
|
|
"default_key": "housing"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000003",
|
|
"default_key": "home"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000004",
|
|
"default_key": "utilities"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000012",
|
|
"default_key": "insurance"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000005",
|
|
"default_key": "transport"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000006",
|
|
"default_key": "travel"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000007",
|
|
"default_key": "entertainment"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000008",
|
|
"default_key": "health"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000013",
|
|
"default_key": "children"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000009",
|
|
"default_key": "shopping"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000014",
|
|
"default_key": "fees"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-00000000000a",
|
|
"default_key": "other"
|
|
}
|
|
],
|
|
"fallback": null
|
|
},
|
|
"expected": {
|
|
"ok": null
|
|
}
|
|
},
|
|
{
|
|
"name": "normalisation: apostrophe deleted",
|
|
"input": {
|
|
"description": "McDonald's",
|
|
"history": [],
|
|
"keywords": [
|
|
{
|
|
"keyword": "mcdonalds",
|
|
"match": "token",
|
|
"default_key": "restaurants"
|
|
}
|
|
],
|
|
"active_categories": [
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000001",
|
|
"default_key": "groceries"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000002",
|
|
"default_key": "restaurants"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000011",
|
|
"default_key": "housing"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000003",
|
|
"default_key": "home"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000004",
|
|
"default_key": "utilities"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000012",
|
|
"default_key": "insurance"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000005",
|
|
"default_key": "transport"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000006",
|
|
"default_key": "travel"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000007",
|
|
"default_key": "entertainment"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000008",
|
|
"default_key": "health"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000013",
|
|
"default_key": "children"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000009",
|
|
"default_key": "shopping"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000014",
|
|
"default_key": "fees"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-00000000000a",
|
|
"default_key": "other"
|
|
}
|
|
],
|
|
"fallback": "01920000-0000-7000-8000-00000000000a"
|
|
},
|
|
"expected": {
|
|
"ok": "01920000-0000-7000-8000-000000000002"
|
|
}
|
|
},
|
|
{
|
|
"name": "normalisation: typographic apostrophe deleted",
|
|
"input": {
|
|
"description": "McDonald\u2019s Centralen",
|
|
"history": [],
|
|
"keywords": [
|
|
{
|
|
"keyword": "mcdonalds",
|
|
"match": "token",
|
|
"default_key": "restaurants"
|
|
}
|
|
],
|
|
"active_categories": [
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000001",
|
|
"default_key": "groceries"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000002",
|
|
"default_key": "restaurants"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000011",
|
|
"default_key": "housing"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000003",
|
|
"default_key": "home"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000004",
|
|
"default_key": "utilities"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000012",
|
|
"default_key": "insurance"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000005",
|
|
"default_key": "transport"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000006",
|
|
"default_key": "travel"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000007",
|
|
"default_key": "entertainment"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000008",
|
|
"default_key": "health"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000013",
|
|
"default_key": "children"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000009",
|
|
"default_key": "shopping"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000014",
|
|
"default_key": "fees"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-00000000000a",
|
|
"default_key": "other"
|
|
}
|
|
],
|
|
"fallback": "01920000-0000-7000-8000-00000000000a"
|
|
},
|
|
"expected": {
|
|
"ok": "01920000-0000-7000-8000-000000000002"
|
|
}
|
|
},
|
|
{
|
|
"name": "normalisation: colon deleted",
|
|
"input": {
|
|
"description": "Willy:s",
|
|
"history": [],
|
|
"keywords": [
|
|
{
|
|
"keyword": "willys",
|
|
"match": "token",
|
|
"default_key": "groceries"
|
|
}
|
|
],
|
|
"active_categories": [
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000001",
|
|
"default_key": "groceries"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000002",
|
|
"default_key": "restaurants"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000011",
|
|
"default_key": "housing"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000003",
|
|
"default_key": "home"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000004",
|
|
"default_key": "utilities"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000012",
|
|
"default_key": "insurance"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000005",
|
|
"default_key": "transport"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000006",
|
|
"default_key": "travel"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000007",
|
|
"default_key": "entertainment"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000008",
|
|
"default_key": "health"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000013",
|
|
"default_key": "children"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000009",
|
|
"default_key": "shopping"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000014",
|
|
"default_key": "fees"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-00000000000a",
|
|
"default_key": "other"
|
|
}
|
|
],
|
|
"fallback": "01920000-0000-7000-8000-00000000000a"
|
|
},
|
|
"expected": {
|
|
"ok": "01920000-0000-7000-8000-000000000001"
|
|
}
|
|
},
|
|
{
|
|
"name": "normalisation: comma becomes a space",
|
|
"input": {
|
|
"description": "Taxi,hem",
|
|
"history": [],
|
|
"keywords": [
|
|
{
|
|
"keyword": "taxi",
|
|
"match": "token",
|
|
"default_key": "transport"
|
|
}
|
|
],
|
|
"active_categories": [
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000001",
|
|
"default_key": "groceries"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000002",
|
|
"default_key": "restaurants"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000011",
|
|
"default_key": "housing"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000003",
|
|
"default_key": "home"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000004",
|
|
"default_key": "utilities"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000012",
|
|
"default_key": "insurance"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000005",
|
|
"default_key": "transport"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000006",
|
|
"default_key": "travel"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000007",
|
|
"default_key": "entertainment"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000008",
|
|
"default_key": "health"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000013",
|
|
"default_key": "children"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000009",
|
|
"default_key": "shopping"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000014",
|
|
"default_key": "fees"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-00000000000a",
|
|
"default_key": "other"
|
|
}
|
|
],
|
|
"fallback": "01920000-0000-7000-8000-00000000000a"
|
|
},
|
|
"expected": {
|
|
"ok": "01920000-0000-7000-8000-000000000005"
|
|
}
|
|
},
|
|
{
|
|
"name": "normalisation: hyphen splits tokens, maxi is not max",
|
|
"input": {
|
|
"description": "ICA-Maxi",
|
|
"history": [],
|
|
"keywords": [
|
|
{
|
|
"keyword": "ica",
|
|
"match": "token",
|
|
"default_key": "groceries"
|
|
},
|
|
{
|
|
"keyword": "max",
|
|
"match": "token",
|
|
"default_key": "restaurants"
|
|
}
|
|
],
|
|
"active_categories": [
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000001",
|
|
"default_key": "groceries"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000002",
|
|
"default_key": "restaurants"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000011",
|
|
"default_key": "housing"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000003",
|
|
"default_key": "home"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000004",
|
|
"default_key": "utilities"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000012",
|
|
"default_key": "insurance"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000005",
|
|
"default_key": "transport"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000006",
|
|
"default_key": "travel"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000007",
|
|
"default_key": "entertainment"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000008",
|
|
"default_key": "health"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000013",
|
|
"default_key": "children"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000009",
|
|
"default_key": "shopping"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000014",
|
|
"default_key": "fees"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-00000000000a",
|
|
"default_key": "other"
|
|
}
|
|
],
|
|
"fallback": "01920000-0000-7000-8000-00000000000a"
|
|
},
|
|
"expected": {
|
|
"ok": "01920000-0000-7000-8000-000000000001"
|
|
}
|
|
},
|
|
{
|
|
"name": "normalisation: underscore is not a letter",
|
|
"input": {
|
|
"description": "taxi_hem",
|
|
"history": [],
|
|
"keywords": [
|
|
{
|
|
"keyword": "taxi",
|
|
"match": "token",
|
|
"default_key": "transport"
|
|
}
|
|
],
|
|
"active_categories": [
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000001",
|
|
"default_key": "groceries"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000002",
|
|
"default_key": "restaurants"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000011",
|
|
"default_key": "housing"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000003",
|
|
"default_key": "home"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000004",
|
|
"default_key": "utilities"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000012",
|
|
"default_key": "insurance"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000005",
|
|
"default_key": "transport"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000006",
|
|
"default_key": "travel"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000007",
|
|
"default_key": "entertainment"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000008",
|
|
"default_key": "health"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000013",
|
|
"default_key": "children"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000009",
|
|
"default_key": "shopping"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000014",
|
|
"default_key": "fees"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-00000000000a",
|
|
"default_key": "other"
|
|
}
|
|
],
|
|
"fallback": "01920000-0000-7000-8000-00000000000a"
|
|
},
|
|
"expected": {
|
|
"ok": "01920000-0000-7000-8000-000000000005"
|
|
}
|
|
},
|
|
{
|
|
"name": "normalisation: emoji become spaces",
|
|
"input": {
|
|
"description": "Pizza\ud83c\udf55Hut",
|
|
"history": [],
|
|
"keywords": [
|
|
{
|
|
"keyword": "pizz",
|
|
"match": "prefix",
|
|
"default_key": "restaurants"
|
|
}
|
|
],
|
|
"active_categories": [
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000001",
|
|
"default_key": "groceries"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000002",
|
|
"default_key": "restaurants"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000011",
|
|
"default_key": "housing"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000003",
|
|
"default_key": "home"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000004",
|
|
"default_key": "utilities"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000012",
|
|
"default_key": "insurance"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000005",
|
|
"default_key": "transport"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000006",
|
|
"default_key": "travel"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000007",
|
|
"default_key": "entertainment"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000008",
|
|
"default_key": "health"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000013",
|
|
"default_key": "children"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000009",
|
|
"default_key": "shopping"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000014",
|
|
"default_key": "fees"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-00000000000a",
|
|
"default_key": "other"
|
|
}
|
|
],
|
|
"fallback": "01920000-0000-7000-8000-00000000000a"
|
|
},
|
|
"expected": {
|
|
"ok": "01920000-0000-7000-8000-000000000002"
|
|
}
|
|
},
|
|
{
|
|
"name": "normalisation: ampersand kept inside a token",
|
|
"input": {
|
|
"description": "H&M",
|
|
"history": [],
|
|
"keywords": [
|
|
{
|
|
"keyword": "h&m",
|
|
"match": "token",
|
|
"default_key": "shopping"
|
|
}
|
|
],
|
|
"active_categories": [
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000001",
|
|
"default_key": "groceries"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000002",
|
|
"default_key": "restaurants"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000011",
|
|
"default_key": "housing"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000003",
|
|
"default_key": "home"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000004",
|
|
"default_key": "utilities"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000012",
|
|
"default_key": "insurance"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000005",
|
|
"default_key": "transport"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000006",
|
|
"default_key": "travel"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000007",
|
|
"default_key": "entertainment"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000008",
|
|
"default_key": "health"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000013",
|
|
"default_key": "children"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000009",
|
|
"default_key": "shopping"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000014",
|
|
"default_key": "fees"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-00000000000a",
|
|
"default_key": "other"
|
|
}
|
|
],
|
|
"fallback": "01920000-0000-7000-8000-00000000000a"
|
|
},
|
|
"expected": {
|
|
"ok": "01920000-0000-7000-8000-000000000009"
|
|
}
|
|
},
|
|
{
|
|
"name": "normalisation: ampersand between spaces is a token of its own",
|
|
"input": {
|
|
"description": "H & M",
|
|
"history": [],
|
|
"keywords": [
|
|
{
|
|
"keyword": "h&m",
|
|
"match": "token",
|
|
"default_key": "shopping"
|
|
}
|
|
],
|
|
"active_categories": [
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000001",
|
|
"default_key": "groceries"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000002",
|
|
"default_key": "restaurants"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000011",
|
|
"default_key": "housing"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000003",
|
|
"default_key": "home"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000004",
|
|
"default_key": "utilities"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000012",
|
|
"default_key": "insurance"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000005",
|
|
"default_key": "transport"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000006",
|
|
"default_key": "travel"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000007",
|
|
"default_key": "entertainment"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000008",
|
|
"default_key": "health"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000013",
|
|
"default_key": "children"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000009",
|
|
"default_key": "shopping"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000014",
|
|
"default_key": "fees"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-00000000000a",
|
|
"default_key": "other"
|
|
}
|
|
],
|
|
"fallback": "01920000-0000-7000-8000-00000000000a"
|
|
},
|
|
"expected": {
|
|
"ok": "01920000-0000-7000-8000-00000000000a"
|
|
}
|
|
},
|
|
{
|
|
"name": "normalisation: NFC composes a decomposed ö",
|
|
"input": {
|
|
"description": "Hemko\u0308p",
|
|
"history": [],
|
|
"keywords": [
|
|
{
|
|
"keyword": "hemköp",
|
|
"match": "token",
|
|
"default_key": "groceries"
|
|
}
|
|
],
|
|
"active_categories": [
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000001",
|
|
"default_key": "groceries"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000002",
|
|
"default_key": "restaurants"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000011",
|
|
"default_key": "housing"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000003",
|
|
"default_key": "home"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000004",
|
|
"default_key": "utilities"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000012",
|
|
"default_key": "insurance"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000005",
|
|
"default_key": "transport"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000006",
|
|
"default_key": "travel"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000007",
|
|
"default_key": "entertainment"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000008",
|
|
"default_key": "health"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000013",
|
|
"default_key": "children"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000009",
|
|
"default_key": "shopping"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000014",
|
|
"default_key": "fees"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-00000000000a",
|
|
"default_key": "other"
|
|
}
|
|
],
|
|
"fallback": "01920000-0000-7000-8000-00000000000a"
|
|
},
|
|
"expected": {
|
|
"ok": "01920000-0000-7000-8000-000000000001"
|
|
}
|
|
},
|
|
{
|
|
"name": "normalisation: uppercase",
|
|
"input": {
|
|
"description": "SUSHI",
|
|
"history": [],
|
|
"keywords": [
|
|
{
|
|
"keyword": "sushi",
|
|
"match": "token",
|
|
"default_key": "restaurants"
|
|
}
|
|
],
|
|
"active_categories": [
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000001",
|
|
"default_key": "groceries"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000002",
|
|
"default_key": "restaurants"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000011",
|
|
"default_key": "housing"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000003",
|
|
"default_key": "home"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000004",
|
|
"default_key": "utilities"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000012",
|
|
"default_key": "insurance"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000005",
|
|
"default_key": "transport"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000006",
|
|
"default_key": "travel"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000007",
|
|
"default_key": "entertainment"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000008",
|
|
"default_key": "health"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000013",
|
|
"default_key": "children"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000009",
|
|
"default_key": "shopping"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000014",
|
|
"default_key": "fees"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-00000000000a",
|
|
"default_key": "other"
|
|
}
|
|
],
|
|
"fallback": "01920000-0000-7000-8000-00000000000a"
|
|
},
|
|
"expected": {
|
|
"ok": "01920000-0000-7000-8000-000000000002"
|
|
}
|
|
},
|
|
{
|
|
"name": "normalisation: Swedish uppercase letters lowercase",
|
|
"input": {
|
|
"description": "TÅG till Malmö",
|
|
"history": [],
|
|
"keywords": [
|
|
{
|
|
"keyword": "tåg",
|
|
"match": "token",
|
|
"default_key": "transport"
|
|
}
|
|
],
|
|
"active_categories": [
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000001",
|
|
"default_key": "groceries"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000002",
|
|
"default_key": "restaurants"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000011",
|
|
"default_key": "housing"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000003",
|
|
"default_key": "home"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000004",
|
|
"default_key": "utilities"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000012",
|
|
"default_key": "insurance"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000005",
|
|
"default_key": "transport"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000006",
|
|
"default_key": "travel"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000007",
|
|
"default_key": "entertainment"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000008",
|
|
"default_key": "health"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000013",
|
|
"default_key": "children"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000009",
|
|
"default_key": "shopping"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000014",
|
|
"default_key": "fees"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-00000000000a",
|
|
"default_key": "other"
|
|
}
|
|
],
|
|
"fallback": "01920000-0000-7000-8000-00000000000a"
|
|
},
|
|
"expected": {
|
|
"ok": "01920000-0000-7000-8000-000000000005"
|
|
}
|
|
},
|
|
{
|
|
"name": "normalisation: diacritics kept, tag is not tåg",
|
|
"input": {
|
|
"description": "Tag",
|
|
"history": [],
|
|
"keywords": [
|
|
{
|
|
"keyword": "tåg",
|
|
"match": "token",
|
|
"default_key": "transport"
|
|
}
|
|
],
|
|
"active_categories": [
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000001",
|
|
"default_key": "groceries"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000002",
|
|
"default_key": "restaurants"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000011",
|
|
"default_key": "housing"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000003",
|
|
"default_key": "home"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000004",
|
|
"default_key": "utilities"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000012",
|
|
"default_key": "insurance"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000005",
|
|
"default_key": "transport"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000006",
|
|
"default_key": "travel"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000007",
|
|
"default_key": "entertainment"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000008",
|
|
"default_key": "health"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000013",
|
|
"default_key": "children"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000009",
|
|
"default_key": "shopping"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000014",
|
|
"default_key": "fees"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-00000000000a",
|
|
"default_key": "other"
|
|
}
|
|
],
|
|
"fallback": "01920000-0000-7000-8000-00000000000a"
|
|
},
|
|
"expected": {
|
|
"ok": "01920000-0000-7000-8000-00000000000a"
|
|
}
|
|
},
|
|
{
|
|
"name": "normalisation: diacritics kept, cafe is not café",
|
|
"input": {
|
|
"description": "Cafe Ritorno",
|
|
"history": [],
|
|
"keywords": [
|
|
{
|
|
"keyword": "café",
|
|
"match": "token",
|
|
"default_key": "restaurants"
|
|
}
|
|
],
|
|
"active_categories": [
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000001",
|
|
"default_key": "groceries"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000002",
|
|
"default_key": "restaurants"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000011",
|
|
"default_key": "housing"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000003",
|
|
"default_key": "home"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000004",
|
|
"default_key": "utilities"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000012",
|
|
"default_key": "insurance"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000005",
|
|
"default_key": "transport"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000006",
|
|
"default_key": "travel"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000007",
|
|
"default_key": "entertainment"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000008",
|
|
"default_key": "health"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000013",
|
|
"default_key": "children"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000009",
|
|
"default_key": "shopping"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000014",
|
|
"default_key": "fees"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-00000000000a",
|
|
"default_key": "other"
|
|
}
|
|
],
|
|
"fallback": "01920000-0000-7000-8000-00000000000a"
|
|
},
|
|
"expected": {
|
|
"ok": "01920000-0000-7000-8000-00000000000a"
|
|
}
|
|
},
|
|
{
|
|
"name": "normalisation: digits kept",
|
|
"input": {
|
|
"description": "Tele2 faktura",
|
|
"history": [],
|
|
"keywords": [
|
|
{
|
|
"keyword": "tele2",
|
|
"match": "token",
|
|
"default_key": "utilities"
|
|
}
|
|
],
|
|
"active_categories": [
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000001",
|
|
"default_key": "groceries"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000002",
|
|
"default_key": "restaurants"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000011",
|
|
"default_key": "housing"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000003",
|
|
"default_key": "home"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000004",
|
|
"default_key": "utilities"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000012",
|
|
"default_key": "insurance"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000005",
|
|
"default_key": "transport"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000006",
|
|
"default_key": "travel"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000007",
|
|
"default_key": "entertainment"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000008",
|
|
"default_key": "health"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000013",
|
|
"default_key": "children"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000009",
|
|
"default_key": "shopping"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000014",
|
|
"default_key": "fees"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-00000000000a",
|
|
"default_key": "other"
|
|
}
|
|
],
|
|
"fallback": "01920000-0000-7000-8000-00000000000a"
|
|
},
|
|
"expected": {
|
|
"ok": "01920000-0000-7000-8000-000000000004"
|
|
}
|
|
},
|
|
{
|
|
"name": "normalisation: letters and digits in one token",
|
|
"input": {
|
|
"description": "OKQ8 Lund",
|
|
"history": [],
|
|
"keywords": [
|
|
{
|
|
"keyword": "okq8",
|
|
"match": "token",
|
|
"default_key": "transport"
|
|
}
|
|
],
|
|
"active_categories": [
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000001",
|
|
"default_key": "groceries"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000002",
|
|
"default_key": "restaurants"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000011",
|
|
"default_key": "housing"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000003",
|
|
"default_key": "home"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000004",
|
|
"default_key": "utilities"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000012",
|
|
"default_key": "insurance"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000005",
|
|
"default_key": "transport"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000006",
|
|
"default_key": "travel"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000007",
|
|
"default_key": "entertainment"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000008",
|
|
"default_key": "health"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000013",
|
|
"default_key": "children"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000009",
|
|
"default_key": "shopping"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-000000000014",
|
|
"default_key": "fees"
|
|
},
|
|
{
|
|
"id": "01920000-0000-7000-8000-00000000000a",
|
|
"default_key": "other"
|
|
}
|
|
],
|
|
"fallback": "01920000-0000-7000-8000-00000000000a"
|
|
},
|
|
"expected": {
|
|
"ok": "01920000-0000-7000-8000-000000000005"
|
|
}
|
|
}
|
|
]
|
|
}
|