Skip to content

Commit fd70aed

Browse files
committed
shiritori: LOOSE -> LOSE
1 parent ca5bf69 commit fd70aed

File tree

4 files changed

+18
-18
lines changed

4 files changed

+18
-18
lines changed

functions/index.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,9 +58,9 @@ app.intent('actions.intent.TEXT', async (conv, input) => {
5858
text: `${result.word} [${result.kana}]`
5959
}));
6060
break;
61-
case shiritori.state.LOOSE_N:
62-
case shiritori.state.LOOSE_USED:
63-
case shiritori.state.LOOSE_CHAIN:
61+
case shiritori.state.LOSE_N:
62+
case shiritori.state.LOSE_USED:
63+
case shiritori.state.LOSE_CHAIN:
6464
conv.close('ざんねん。あなたの負けです。');
6565
break;
6666
case shiritori.state.WIN_N:

functions/shiritori/index.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,11 @@ const loaded = kuroshiro.init(new KuromojiAnalyzer())
2626

2727
exports.state = Object.freeze({
2828
CONTINUE: 0,
29-
LOOSE_N: 1,
29+
LOSE_N: 1,
3030
WIN_N: 2,
31-
LOOSE_USED: 3,
31+
LOSE_USED: 3,
3232
WIN_USED: 4,
33-
LOOSE_CHAIN: 5
33+
LOSE_CHAIN: 5
3434
})
3535

3636
// https://github.com/hexenq/kuroshiro/issues/64
@@ -44,7 +44,7 @@ exports.check = (word, chain) => loaded.then(async () => {
4444
// 「ん」で終わるかどうか?
4545
const wordHira = await toHiragana(word)
4646
if (wordHira[wordHira.length - 1] === 'ん') {
47-
return exports.state.LOOSE_N
47+
return exports.state.LOSE_N
4848
}
4949

5050
// 漢字からひらがなにする。
@@ -55,7 +55,7 @@ exports.check = (word, chain) => loaded.then(async () => {
5555
// 使った名詞をチェックする。
5656
const chainHira = await Promise.all(chain.map(toHiragana))
5757
if (chainHira.includes(wordHira)) {
58-
return exports.state.LOOSE_USED
58+
return exports.state.LOSE_USED
5959
}
6060

6161
// しりとりの最初の文字をチェックする。
@@ -66,7 +66,7 @@ exports.check = (word, chain) => loaded.then(async () => {
6666
return exports.state.CONTINUE
6767
}
6868
}
69-
return exports.state.LOOSE_CHAIN
69+
return exports.state.LOSE_CHAIN
7070
})
7171

7272
// 名詞からしりとりのひらがなを選ぶ。

functions/shiritori/main.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,9 @@ rl.on('line', async input => {
4242
chain.unshift(result.kana)
4343
rl.prompt()
4444
break
45-
case shiritori.state.LOOSE_N:
46-
case shiritori.state.LOOSE_USED:
47-
case shiritori.state.LOOSE_CHAIN:
45+
case shiritori.state.LOSE_N:
46+
case shiritori.state.LOSE_USED:
47+
case shiritori.state.LOSE_CHAIN:
4848
console.log('ざんねん。')
4949
process.exit(-1)
5050
case shiritori.state.WIN_N:

functions/shiritori/test.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,19 +22,19 @@ test('check: continue', async t => {
2222

2323
test('check: loose ん', async t => {
2424
t.is(await shiritori.check('とん', ['べんと']),
25-
shiritori.state.LOOSE_N)
25+
shiritori.state.LOSE_N)
2626
t.is(await shiritori.check('トン', ['べんと']),
27-
shiritori.state.LOOSE_N)
27+
shiritori.state.LOSE_N)
2828
})
2929

3030
test('check: loose used', async t => {
3131
t.is(await shiritori.check('とんかつ', ['べんと', 'トンカツ']),
32-
shiritori.state.LOOSE_USED)
32+
shiritori.state.LOSE_USED)
3333
})
3434

3535
test('check: loose chain', async t => {
3636
t.is(await shiritori.check('とんかつ', ['エビフライ']),
37-
shiritori.state.LOOSE_CHAIN)
37+
shiritori.state.LOSE_CHAIN)
3838
})
3939

4040
test('check: ー rules', async t => {
@@ -51,7 +51,7 @@ test('check: ー rules', async t => {
5151
t.is(await shiritori.check('田んぼ', ['スプリンター']),
5252
shiritori.state.CONTINUE)
5353
t.is(await shiritori.check('とんかつ', ['りかー']),
54-
shiritori.state.LOOSE_CHAIN)
54+
shiritori.state.LOSE_CHAIN)
5555
})
5656

5757
test('check: ぁぃぅぇぉゃゅょ rules', async t => {
@@ -103,7 +103,7 @@ test('interact: next', async t => {
103103

104104
test('interact: lose', async t => {
105105
const result = await shiritori.interact(dict, 'つと', ['とつ', 'つと'])
106-
t.is(result.state, shiritori.state.LOOSE_USED)
106+
t.is(result.state, shiritori.state.LOSE_USED)
107107
})
108108

109109
test('interact: win used', async t => {

0 commit comments

Comments
 (0)