Skip to content

Commit

Permalink
Add tests for TokenDelimit
Browse files Browse the repository at this point in the history
  • Loading branch information
kou committed Nov 9, 2012
1 parent 8127498 commit 9e4e9b1
Show file tree
Hide file tree
Showing 4 changed files with 130 additions and 0 deletions.
@@ -0,0 +1,50 @@
table_create Tags TABLE_PAT_KEY ShortText --default_tokenizer TokenDelimit
[[0,0.0,0.0],true]
table_create Movies TABLE_HASH_KEY ShortText
[[0,0.0,0.0],true]
column_create Movies tags COLUMN_VECTOR Tags
[[0,0.0,0.0],true]
column_create Tags movies_tags COLUMN_INDEX Movies tags
[[0,0.0,0.0],true]
load --table Movies
[
{"_key": "Seven Samurai", tags: "Samurai Japanese Japan"},
{"_key": "The Last Samurai", tags: "Samurai English Japanese US Japan"}
]
[[0,0.0,0.0],2]
select Tags --output_columns _key --limit -1
[
[
0,
0.0,
0.0
],
[
[
[
5
],
[
[
"_key",
"ShortText"
]
],
[
"English"
],
[
"Japan"
],
[
"Japanese"
],
[
"Samurai"
],
[
"US"
]
]
]
]
@@ -0,0 +1,15 @@
table_create Tags TABLE_PAT_KEY ShortText \
--default_tokenizer TokenDelimit

table_create Movies TABLE_HASH_KEY ShortText
column_create Movies tags COLUMN_VECTOR Tags

column_create Tags movies_tags COLUMN_INDEX Movies tags

load --table Movies
[
{"_key": "Seven Samurai", tags: "Samurai Japanese Japan"},
{"_key": "The Last Samurai", tags: "Samurai English Japanese US Japan"}
]

select Tags --output_columns _key --limit -1
@@ -0,0 +1,50 @@
table_create Tags TABLE_PAT_KEY|KEY_NORMALIZE ShortText --default_tokenizer TokenDelimit
[[0,0.0,0.0],true]
table_create Movies TABLE_HASH_KEY ShortText
[[0,0.0,0.0],true]
column_create Movies tags COLUMN_VECTOR Tags
[[0,0.0,0.0],true]
column_create Tags movies_tags COLUMN_INDEX Movies tags
[[0,0.0,0.0],true]
load --table Movies
[
{"_key": "Seven Samurai", tags: "Samurai Japanese Japan"},
{"_key": "The Last Samurai", tags: "Samurai English Japanese US Japan"}
]
[[0,0.0,0.0],2]
select Tags --output_columns _key --limit -1
[
[
0,
0.0,
0.0
],
[
[
[
5
],
[
[
"_key",
"ShortText"
]
],
[
"english"
],
[
"japan"
],
[
"japanese"
],
[
"samurai"
],
[
"us"
]
]
]
]
@@ -0,0 +1,15 @@
table_create Tags TABLE_PAT_KEY|KEY_NORMALIZE ShortText \
--default_tokenizer TokenDelimit

table_create Movies TABLE_HASH_KEY ShortText
column_create Movies tags COLUMN_VECTOR Tags

column_create Tags movies_tags COLUMN_INDEX Movies tags

load --table Movies
[
{"_key": "Seven Samurai", tags: "Samurai Japanese Japan"},
{"_key": "The Last Samurai", tags: "Samurai English Japanese US Japan"}
]

select Tags --output_columns _key --limit -1

0 comments on commit 9e4e9b1

Please sign in to comment.