Skip to content
This repository has been archived by the owner on May 22, 2019. It is now read-only.

Commit

Permalink
Enhance tests for TokenParser
Browse files Browse the repository at this point in the history
Signed-off-by: Irina <irenekhismatullina@gmail.com>
  • Loading branch information
irinakhismatullina committed Apr 16, 2019
1 parent badee8d commit 0a9c4f9
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions sourced/ml/tests/test_token_parser.py
Expand Up @@ -13,6 +13,8 @@ def test_process_token(self):
self.tp.max_token_length = 100

tokens = [
("ONLYCAPS", ["onlycap"]),
("nocaps", ["nocap"]),
("UpperCamelCase", ["upper", "camel", "case"]),
("camelCase", ["camel", "case"]),
("FRAPScase", ["frap", "case"]),
Expand Down Expand Up @@ -57,6 +59,8 @@ def test_process_token_with_attach_upper(self):
tp = TokenParser(stem_threshold=100, single_shot=True, max_token_length=100,
min_split_length=1)
tokens = [
("ONLYCAPS", ["onlycaps"]),
("nocaps", ["nocaps"]),
("UpperCamelCase", ["upper", "camel", "case"]),
("camelCase", ["camel", "case"]),
("FRAPScase", ["frap", "scase"]),
Expand Down Expand Up @@ -101,6 +105,8 @@ def test_process_token_single_shot(self):
self.tp._single_shot = True
self.tp.min_split_length = 1
tokens = [
("ONLYCAPS", ["onlycap"]),
("nocaps", ["nocap"]),
("UpperCamelCase", ["upper", "camel", "case"]),
("camelCase", ["camel", "case"]),
("FRAPScase", ["frap", "case"]),
Expand Down Expand Up @@ -178,6 +184,8 @@ def test_reconstruct(self):
self.tp.min_split_length = 1

tokens = [
"ONLYCAPS",
"nocaps",
"UpperCamelCase",
"camelCase",
"FRAPScase",
Expand Down

0 comments on commit 0a9c4f9

Please sign in to comment.