コミットを比較
19
コミット
| 作成者 | SHA1 | 日付 | |
|---|---|---|---|
|
|
2522485f6a | ||
|
|
de5db81e16 | ||
|
|
fd90ef3b15 | ||
|
|
4caea6213a | ||
|
|
884a7bc3da | ||
|
|
f936c1e5ce | ||
|
|
8bf51bbb4a | ||
|
|
480a06caaf | ||
|
|
7fe7dbd909 | ||
|
|
159ad5ed5a | ||
|
|
ae1deaac8c | ||
|
|
be5359eb84 | ||
|
|
a1ea35a7ec | ||
|
|
49d42d576a | ||
|
|
77b5c8f262 | ||
|
|
543f051f8f | ||
|
|
fb2b2a632c | ||
|
|
de21141f5a | ||
|
|
96df2a4eaa |
@@ -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 = (
|
const isMonthCrossMatch = (
|
||||||
candidate: GekanatorQuestion['condition'],
|
candidate: GekanatorQuestion['condition'],
|
||||||
previous: GekanatorQuestion['condition'],
|
previous: GekanatorQuestion['condition'],
|
||||||
@@ -808,7 +920,7 @@ const chooseQuestion = ({
|
|||||||
|
|
||||||
return questionsToRank
|
return questionsToRank
|
||||||
.map (question => {
|
.map (question => {
|
||||||
if (isQuestionRedundantAfterAnswers (question, answers))
|
if (isQuestionHardFilteredAfterAnswers (question, answers))
|
||||||
return null
|
return null
|
||||||
|
|
||||||
const signature = signatureFor (question, candidates)
|
const signature = signatureFor (question, candidates)
|
||||||
|
|||||||
新しいイシューから参照
ユーザーをブロックする