We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent d6a7d7c commit 806052fCopy full SHA for 806052f
backend/src/lib/gemini.ts
@@ -116,6 +116,16 @@ const generateTanka = async (originalText: string): Promise<string[]> => {
116
const count = validChars.length;
117
// console.log('count: ', count);
118
119
+ // 短歌に「()()」があればふりがなも一緒に出力したと判定してfalseを返す
120
+ if (
121
+ line.includes('(') ||
122
+ line.includes(')') ||
123
+ line.includes('(') ||
124
+ line.includes(')')
125
+ ) {
126
+ return false;
127
+ }
128
+
129
// 文字数をカウント(アルファベット(全角、半角)、ひらがな、カタカナ、漢字を1文字としてカウント)
130
return Math.abs(count - expectedCharaCount[index]) <= 1; // 1文字分までの誤差は許容
131
});
0 commit comments