forked from exercism/problem-specifications
-
Notifications
You must be signed in to change notification settings - Fork 0
/
anagram.json
122 lines (122 loc) · 4.37 KB
/
anagram.json
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
{
"#": [
"The string argument cases possible matches are passed in as",
"individual arguments rather than arrays. Languages can include",
"these string argument cases if passing individual arguments is",
"idiomatic in that language.",
"Some tests have a \"comment\" property, which provides more",
"information that could be added to the test case as a code comment."
],
"cases": [
{
"description": "no matches",
"subject": "diaper",
"candidates": [ "hello", "world", "zombies", "pants"],
"expected": []
},
{
"description": "detects simple anagram",
"subject": "ant",
"candidates": ["tan", "stand", "at"],
"expected": ["tan"]
},
{
"description": "does not detect false positives",
"subject": "galea",
"candidates": ["eagle"],
"expected": []
},
{
"description": "detects multiple anagrams",
"subject": "master",
"candidates": ["stream", "pigeon", "maters"],
"expected": ["stream", "maters"]
},
{
"description": "does not detect anagram subsets",
"subject": "good",
"candidates": ["dog", "goody"],
"expected": []
},
{
"description": "detects anagram",
"subject": "listen",
"candidates": ["enlists", "google", "inlets", "banana"],
"expected": ["inlets"]
},
{
"description": "detects multiple anagrams",
"subject": "allergy",
"candidates": ["gallery", "ballerina", "regally", "clergy", "largely", "leading"],
"expected": ["gallery", "regally", "largely"]
},
{
"description": "does not detect identical words",
"subject": "corn",
"candidates": ["corn", "dark", "Corn", "rank", "CORN", "cron", "park"],
"expected": ["cron"]
},
{
"description": "does not detect non-anagrams with identical checksum",
"subject": "mass",
"candidates": ["last"],
"expected": []
},
{
"description": "detects anagrams case-insensitively",
"subject": "Orchestra",
"candidates": ["cashregister", "Carthorse", "radishes"],
"expected": ["Carthorse"]
},
{
"description": "detects anagrams using case-insensitive subject",
"subject": "Orchestra",
"candidates": ["cashregister", "carthorse", "radishes"],
"expected": ["carthorse"]
},
{
"description": "detects anagrams using case-insensitive possible matches",
"subject": "orchestra",
"candidates": ["cashregister", "Carthorse", "radishes"],
"expected": ["Carthorse"]
},
{
"description": "does not detect a word as its own anagram",
"subject": "banana",
"candidates": ["Banana"],
"expected": []
},
{
"description": "does not detect a anagram if the original word is repeated",
"subject": "go",
"candidates": ["go Go GO"],
"expected": []
},
{
"description": "anagrams must use all letters exactly once",
"subject": "tapper",
"candidates": ["patter"],
"expected": []
},
{
"description": "detects unicode anagrams",
"comment": "These words don't make sense, they're just greek letters cobbled together.",
"subject": "ΑΒΓ",
"candidates": ["ΒΓΑ", "ΒΓΔ", "γβα"],
"expected": ["ΒΓΑ", "γβα"]
},
{
"description": "eliminates misleading unicode anagrams",
"comment": "Despite what a human might think these words different letters, the candidates uses Greek A and B while the list of potential anagrams uses Latin A and B.",
"subject": "ΑΒΓ",
"candidates": ["ABΓ"],
"expected": []
},
{
"description": "capital word is not own anagram",
"subject": "BANANA",
"candidates": ["Banana"],
"expected": []
}
]
}