Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master' into add-date-to-fragment
Browse files Browse the repository at this point in the history
  • Loading branch information
khoidt committed Sep 7, 2023
2 parents 03fc524 + ec76f0e commit ba52efd
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 11 deletions.
1 change: 1 addition & 0 deletions src/fragmentarium/domain/annotation-token.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ export class AnnotationToken {
| AnnotationTokenType.HasSign
| AnnotationTokenType.Number
| AnnotationTokenType.PartiallyBroken
| AnnotationTokenType.Damaged
| AnnotationTokenType.CompoundGrapheme
| AnnotationTokenType.SurfaceAtLine
| AnnotationTokenType.RulingDollarLine
Expand Down
1 change: 1 addition & 0 deletions src/fragmentarium/domain/annotation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ export enum AnnotationTokenType {
Blank = 'Blank',
Disabled = 'Disabled',
PartiallyBroken = 'PartiallyBroken',
Damaged = 'Damaged',
CompletelyBroken = 'CompletelyBroken',
Predicted = 'Predicted',
Struct = 'Struct',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,25 +25,28 @@ function namedSignTokenToAnnotationToken(
token: NamedSign,
path: readonly number[]
): AnnotationToken {
let tokenType: AnnotationTokenType
if (effectiveEnclosure(token).includes('BROKEN_AWAY')) {
return AnnotationToken.initDeactive(
'',
AnnotationTokenType.CompletelyBroken,
path
)
} else if (token.flags.includes('#')) {
tokenType = AnnotationTokenType.Damaged
} else if (isStrictlyPartiallyEnclosed(token, 'BROKEN_AWAY')) {
tokenType = AnnotationTokenType.PartiallyBroken
} else {
const type = isStrictlyPartiallyEnclosed(token, 'BROKEN_AWAY')
? AnnotationTokenType.PartiallyBroken
: typeToAnnotationTokenType(token.type)
return AnnotationToken.initActive(
token.cleanValue,
type,
token.value,
path,
token.name,
token.subIndex
)
tokenType = typeToAnnotationTokenType(token.type)
}
return AnnotationToken.initActive(
token.cleanValue,
tokenType,
token.value,
path,
token.name,
token.subIndex
)
}

function compoundGraphemeToAnnotationToken(
Expand Down

0 comments on commit ba52efd

Please sign in to comment.