コミットを比較

...

19 コミット

作成者 SHA1 メッセージ 日付
みてるぞ 2522485f6a Merge remote-tracking branch 'origin/main' into feature/041 2026-06-11 23:58:00 +09:00
みてるぞ de5db81e16 #41 2026-06-11 23:54:55 +09:00
みてるぞ fd90ef3b15 Merge remote-tracking branch 'origin/main' into feature/041 2026-06-11 23:18:57 +09:00
みてるぞ 4caea6213a #41 少々しやぅ修正 2026-06-11 23:18:37 +09:00
みてるぞ 884a7bc3da Merge remote-tracking branch 'origin/main' into feature/041 2026-06-10 23:43:24 +09:00
みてるぞ f936c1e5ce #41 テスト型バグ修正 2026-06-10 23:41:45 +09:00
みてるぞ 8bf51bbb4a #41 2026-06-10 23:17:12 +09:00
みてるぞ 480a06caaf #41 2026-06-10 22:24:01 +09:00
みてるぞ 7fe7dbd909 #41 2026-06-10 20:02:08 +09:00
みてるぞ 159ad5ed5a #41 2026-06-09 23:36:24 +09:00
みてるぞ ae1deaac8c #41 2026-06-09 23:05:37 +09:00
みてるぞ be5359eb84 #41 2026-06-09 08:17:16 +09:00
みてるぞ a1ea35a7ec #41 2026-06-09 01:29:43 +09:00
みてるぞ 49d42d576a #41 2026-06-09 00:35:25 +09:00
みてるぞ 77b5c8f262 #41 2026-06-08 17:47:19 +09:00
みてるぞ 543f051f8f #41 2026-06-08 12:44:45 +09:00
みてるぞ fb2b2a632c #41 2026-06-08 08:45:52 +09:00
みてるぞ de21141f5a #41 2026-06-08 08:41:52 +09:00
みてるぞ 96df2a4eaa #41 2026-06-08 00:30:20 +09:00
+113 -1
ファイルの表示
@@ -674,6 +674,118 @@ const isQuestionRedundantAfterAnswers = (
})
const isSourceFactBlocked = (
candidate: GekanatorQuestion['condition'],
previous: GekanatorQuestion['condition'],
answer: GekanatorAnswerValue,
): boolean => {
if (candidate.type !== 'source' || previous.type !== 'source')
return false
switch (answer)
{
case 'yes':
return true
case 'no':
return candidate.host === previous.host
default:
return false
}
}
const isOriginalYearFactBlocked = (
candidate: GekanatorQuestion['condition'],
previous: GekanatorQuestion['condition'],
answer: GekanatorAnswerValue,
): boolean => {
if (candidate.type !== 'original-year' || previous.type !== 'original-year')
return false
switch (answer)
{
case 'yes':
return true
case 'no':
return candidate.year === previous.year
default:
return false
}
}
const isOriginalMonthFactBlocked = (
candidate: GekanatorQuestion['condition'],
previous: GekanatorQuestion['condition'],
answer: GekanatorAnswerValue,
): boolean => {
switch (answer)
{
case 'yes':
if (previous.type === 'original-month')
{
if (candidate.type === 'original-month')
return true
if (candidate.type === 'original-month-day')
return monthForCondition (candidate) !== previous.month
return false
}
if (previous.type === 'original-month-day')
return candidate.type === 'original-month'
|| candidate.type === 'original-month-day'
return false
case 'no':
if (previous.type === 'original-month')
{
if (candidate.type === 'original-month')
return candidate.month === previous.month
if (candidate.type === 'original-month-day')
return monthForCondition (candidate) === previous.month
return false
}
if (previous.type === 'original-month-day')
return candidate.type === 'original-month-day'
&& candidate.monthDay === previous.monthDay
return false
default:
return false
}
}
const isFactQuestionBlocked = (
candidate: GekanatorQuestion['condition'],
previous: GekanatorQuestion['condition'],
answer: GekanatorAnswerValue,
): boolean => {
if (!(answer === 'yes' || answer === 'no'))
return false
return isSourceFactBlocked (candidate, previous, answer)
|| isOriginalYearFactBlocked (candidate, previous, answer)
|| isOriginalMonthFactBlocked (candidate, previous, answer)
}
const isQuestionHardFilteredAfterAnswers = (
question: GekanatorQuestion,
answers: GekanatorAnswerLog[],
): boolean => answers.some (answer => {
const previous = answer.questionCondition
if (previous === undefined)
return false
return isQuestionRedundantAfterAnswers (question, [answer])
|| isFactQuestionBlocked (question.condition, previous, answer.answer)
})
const isMonthCrossMatch = (
candidate: GekanatorQuestion['condition'],
previous: GekanatorQuestion['condition'],
@@ -808,7 +920,7 @@ const chooseQuestion = ({
return questionsToRank
.map (question => {
if (isQuestionRedundantAfterAnswers (question, answers))
if (isQuestionHardFilteredAfterAnswers (question, answers))
return null
const signature = signatureFor (question, candidates)