fix: make sure unfortunate combination doesn't only produce 0-9 ranges for matrikelnummer
This commit is contained in:
parent
525e24b56d
commit
8e4cb0917d
@ -567,6 +567,7 @@ examAutoOccurrence (hash -> seed) rule ExamAutoOccurrenceConfig{..} occurrences
|
|||||||
go start borderLength acc ((_occurrenceId, []):t) = go start borderLength acc t
|
go start borderLength acc ((_occurrenceId, []):t) = go start borderLength acc t
|
||||||
go start borderLength acc ((occurrenceId, userTags):t)
|
go start borderLength acc ((occurrenceId, userTags):t)
|
||||||
| matchMappingDescription mappingDescription userTags
|
| matchMappingDescription mappingDescription userTags
|
||||||
|
&& (null t || Just (toNullable nextStart) > maybeEnd)
|
||||||
= go nextStart borderLength ((occurrenceId, mappingDescription) : acc) t
|
= go nextStart borderLength ((occurrenceId, mappingDescription) : acc) t
|
||||||
| borderLength < maxTagLength
|
| borderLength < maxTagLength
|
||||||
= go (singleton $ head alphabet) (succ borderLength) [] result
|
= go (singleton $ head alphabet) (succ borderLength) [] result
|
||||||
@ -586,6 +587,8 @@ examAutoOccurrence (hash -> seed) rule ExamAutoOccurrenceConfig{..} occurrences
|
|||||||
-- | pre/suffix of largest user tag
|
-- | pre/suffix of largest user tag
|
||||||
maybeEnd :: Maybe [CI Char]
|
maybeEnd :: Maybe [CI Char]
|
||||||
maybeEnd = case t of
|
maybeEnd = case t of
|
||||||
|
-- TODO account for special tags
|
||||||
|
-- e.g. don't stop at T if Ù is in the special prefix set
|
||||||
[] -> Just $ replicate borderLength $ last alphabet
|
[] -> Just $ replicate borderLength $ last alphabet
|
||||||
_nonEmpty -> transformTag borderLength . maximum <$> fromNullable alphabetTags
|
_nonEmpty -> transformTag borderLength . maximum <$> fromNullable alphabetTags
|
||||||
nextStart :: NonNull [CI Char]
|
nextStart :: NonNull [CI Char]
|
||||||
|
|||||||
Reference in New Issue
Block a user