@tiqian/engine 0.0.1 → 0.1.0-alpha.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/org/tiqian/clreq/AdjustmentStylePolicy.d.ts +11 -0
- package/dist/org/tiqian/clreq/AdjustmentStylePolicy.js +21 -0
- package/dist/org/tiqian/clreq/AutoSpaceMode.d.ts +16 -0
- package/dist/org/tiqian/clreq/AutoSpaceMode.js +17 -0
- package/dist/org/tiqian/clreq/AutoSpacePolicy.d.ts +13 -0
- package/dist/org/tiqian/clreq/AutoSpacePolicy.js +23 -0
- package/dist/org/tiqian/clreq/BopomofoParser.d.ts +10 -0
- package/dist/org/tiqian/clreq/BopomofoParser.js +46 -0
- package/dist/org/tiqian/clreq/BopomofoReading.d.ts +12 -0
- package/dist/org/tiqian/clreq/BopomofoReading.js +86 -0
- package/dist/org/tiqian/clreq/BopomofoTone.d.ts +28 -0
- package/dist/org/tiqian/clreq/BopomofoTone.js +26 -0
- package/dist/org/tiqian/clreq/CjkPunctuationGlyphPolicy.d.ts +16 -0
- package/dist/org/tiqian/clreq/CjkPunctuationGlyphPolicy.js +17 -0
- package/dist/org/tiqian/clreq/CjkPunctuationGlyphSubstitution.d.ts +8 -0
- package/dist/org/tiqian/clreq/CjkPunctuationGlyphSubstitution.js +25 -0
- package/dist/org/tiqian/clreq/ClreqProfile.d.ts +27 -0
- package/dist/org/tiqian/clreq/ClreqProfile.js +58 -0
- package/dist/org/tiqian/clreq/ClreqProfileResolver.d.ts +10 -0
- package/dist/org/tiqian/clreq/ClreqProfileResolver.js +13 -0
- package/dist/org/tiqian/clreq/ClreqPunctuationAdvancePolicy.d.ts +7 -0
- package/dist/org/tiqian/clreq/ClreqPunctuationAdvancePolicy.js +40 -0
- package/dist/org/tiqian/clreq/ClreqPunctuationGlyphSubstitutor.d.ts +19 -0
- package/dist/org/tiqian/clreq/ClreqPunctuationGlyphSubstitutor.js +93 -0
- package/dist/org/tiqian/clreq/ClreqPunctuationPolicies.d.ts +26 -0
- package/dist/org/tiqian/clreq/ClreqPunctuationPolicies.js +137 -0
- package/dist/org/tiqian/clreq/ClreqRegion.d.ts +20 -0
- package/dist/org/tiqian/clreq/ClreqRegion.js +20 -0
- package/dist/org/tiqian/clreq/ClreqStrictness.d.ts +16 -0
- package/dist/org/tiqian/clreq/ClreqStrictness.js +17 -0
- package/dist/org/tiqian/clreq/GlueSide.d.ts +16 -0
- package/dist/org/tiqian/clreq/GlueSide.js +17 -0
- package/dist/org/tiqian/clreq/HangingPunctuationStyle.d.ts +12 -0
- package/dist/org/tiqian/clreq/HangingPunctuationStyle.js +14 -0
- package/dist/org/tiqian/clreq/InteriorPunctuationStyle.d.ts +12 -0
- package/dist/org/tiqian/clreq/InteriorPunctuationStyle.js +14 -0
- package/dist/org/tiqian/clreq/KinsokuLevel.d.ts +20 -0
- package/dist/org/tiqian/clreq/KinsokuLevel.js +20 -0
- package/dist/org/tiqian/clreq/KinsokuMode.d.ts +14 -0
- package/dist/org/tiqian/clreq/KinsokuMode.js +2 -0
- package/dist/org/tiqian/clreq/KinsokuModes.d.ts +11 -0
- package/dist/org/tiqian/clreq/KinsokuModes.js +71 -0
- package/dist/org/tiqian/clreq/LineAdjustmentStrategy.d.ts +16 -0
- package/dist/org/tiqian/clreq/LineAdjustmentStrategy.js +17 -0
- package/dist/org/tiqian/clreq/LineEndPunctuationStyle.d.ts +12 -0
- package/dist/org/tiqian/clreq/LineEndPunctuationStyle.js +14 -0
- package/dist/org/tiqian/clreq/NumberSymbolCohesion.d.ts +8 -0
- package/dist/org/tiqian/clreq/NumberSymbolCohesion.js +56 -0
- package/dist/org/tiqian/clreq/PunctuationClass.d.ts +44 -0
- package/dist/org/tiqian/clreq/PunctuationClass.js +38 -0
- package/dist/org/tiqian/clreq/PunctuationGluePlacement.d.ts +12 -0
- package/dist/org/tiqian/clreq/PunctuationGluePlacement.js +14 -0
- package/dist/org/tiqian/clreq/PunctuationGluePlacements.d.ts +9 -0
- package/dist/org/tiqian/clreq/PunctuationGluePlacements.js +49 -0
- package/dist/org/tiqian/clreq/PunctuationPolicy.d.ts +10 -0
- package/dist/org/tiqian/clreq/PunctuationPolicy.js +18 -0
- package/dist/org/tiqian/clreq/PunctuationWidthPolicy.d.ts +8 -0
- package/dist/org/tiqian/clreq/PunctuationWidthPolicy.js +16 -0
- package/dist/org/tiqian/clreq/ResolvedKinsoku.d.ts +12 -0
- package/dist/org/tiqian/clreq/ResolvedKinsoku.js +43 -0
- package/dist/org/tiqian/core/AccurateSum.d.ts +3 -0
- package/dist/org/tiqian/core/AccurateSum.js +9 -0
- package/dist/org/tiqian/core/AutoSpaceDecisionInfo.d.ts +13 -0
- package/dist/org/tiqian/core/AutoSpaceDecisionInfo.js +24 -0
- package/dist/org/tiqian/core/BopomofoDecisionInfo.d.ts +13 -0
- package/dist/org/tiqian/core/BopomofoDecisionInfo.js +32 -0
- package/dist/org/tiqian/core/BopomofoGlyphPlacement.d.ts +16 -0
- package/dist/org/tiqian/core/BopomofoGlyphPlacement.js +33 -0
- package/dist/org/tiqian/core/BopomofoGlyphRole.d.ts +16 -0
- package/dist/org/tiqian/core/BopomofoGlyphRole.js +17 -0
- package/dist/org/tiqian/core/BreakOpportunityDecisionInfo.d.ts +11 -0
- package/dist/org/tiqian/core/BreakOpportunityDecisionInfo.js +52 -0
- package/dist/org/tiqian/core/BuiltInLayoutProfiles.d.ts +4 -0
- package/dist/org/tiqian/core/BuiltInLayoutProfiles.js +5 -0
- package/dist/org/tiqian/core/Cluster.d.ts +13 -0
- package/dist/org/tiqian/core/Cluster.js +24 -0
- package/dist/org/tiqian/core/ClusterGeometryDecisionInfo.d.ts +21 -0
- package/dist/org/tiqian/core/ClusterGeometryDecisionInfo.js +40 -0
- package/dist/org/tiqian/core/ColorSpan.d.ts +8 -0
- package/dist/org/tiqian/core/ColorSpan.js +25 -0
- package/dist/org/tiqian/core/ContextualKinsokuDecisionInfo.d.ts +12 -0
- package/dist/org/tiqian/core/ContextualKinsokuDecisionInfo.js +47 -0
- package/dist/org/tiqian/core/DecorationDecisionInfo.d.ts +13 -0
- package/dist/org/tiqian/core/DecorationDecisionInfo.js +24 -0
- package/dist/org/tiqian/core/DecorationKind.d.ts +20 -0
- package/dist/org/tiqian/core/DecorationKind.js +20 -0
- package/dist/org/tiqian/core/DecorationSegmentInfo.d.ts +15 -0
- package/dist/org/tiqian/core/DecorationSegmentInfo.js +28 -0
- package/dist/org/tiqian/core/DecorationSpan.d.ts +10 -0
- package/dist/org/tiqian/core/DecorationSpan.js +36 -0
- package/dist/org/tiqian/core/EastAsianSpacingData.d.ts +4 -0
- package/dist/org/tiqian/core/EastAsianSpacingData.js +399 -0
- package/dist/org/tiqian/core/EastAsianSpacingEdges.d.ts +8 -0
- package/dist/org/tiqian/core/EastAsianSpacingEdges.js +14 -0
- package/dist/org/tiqian/core/EastAsianSpacingValue.d.ts +20 -0
- package/dist/org/tiqian/core/EastAsianSpacingValue.js +20 -0
- package/dist/org/tiqian/core/EmergencyTrackingEligibilityDecisionInfo.d.ts +9 -0
- package/dist/org/tiqian/core/EmergencyTrackingEligibilityDecisionInfo.js +29 -0
- package/dist/org/tiqian/core/FirstLineIndentDecisionInfo.d.ts +8 -0
- package/dist/org/tiqian/core/FirstLineIndentDecisionInfo.js +16 -0
- package/dist/org/tiqian/core/FittedLinePatternGeometry.d.ts +2 -0
- package/dist/org/tiqian/core/FittedLinePatternGeometry.js +84 -0
- package/dist/org/tiqian/core/FontDecisionInfo.d.ts +13 -0
- package/dist/org/tiqian/core/FontDecisionInfo.js +45 -0
- package/dist/org/tiqian/core/Glyph.d.ts +15 -0
- package/dist/org/tiqian/core/Glyph.js +30 -0
- package/dist/org/tiqian/core/GlyphRun.d.ts +11 -0
- package/dist/org/tiqian/core/GlyphRun.js +28 -0
- package/dist/org/tiqian/core/Ic.d.ts +7 -0
- package/dist/org/tiqian/core/Ic.js +17 -0
- package/dist/org/tiqian/core/IllegalStateException.d.ts +4 -0
- package/dist/org/tiqian/core/IllegalStateException.js +8 -0
- package/dist/org/tiqian/core/InlineAttachment.d.ts +12 -0
- package/dist/org/tiqian/core/InlineAttachment.js +14 -0
- package/dist/org/tiqian/core/InlineBoxDecisionInfo.d.ts +12 -0
- package/dist/org/tiqian/core/InlineBoxDecisionInfo.js +22 -0
- package/dist/org/tiqian/core/InlineBoxOuterSpacing.d.ts +12 -0
- package/dist/org/tiqian/core/InlineBoxOuterSpacing.js +14 -0
- package/dist/org/tiqian/core/InlineBoxSpan.d.ts +10 -0
- package/dist/org/tiqian/core/InlineBoxSpan.js +17 -0
- package/dist/org/tiqian/core/InlineObjectBoundaryAdjustment.d.ts +12 -0
- package/dist/org/tiqian/core/InlineObjectBoundaryAdjustment.js +31 -0
- package/dist/org/tiqian/core/InlineObjectDecisionInfo.d.ts +28 -0
- package/dist/org/tiqian/core/InlineObjectDecisionInfo.js +54 -0
- package/dist/org/tiqian/core/InlineObjectLineHeightDecisionInfo.d.ts +16 -0
- package/dist/org/tiqian/core/InlineObjectLineHeightDecisionInfo.js +57 -0
- package/dist/org/tiqian/core/InlineObjectPreferredStretch.d.ts +11 -0
- package/dist/org/tiqian/core/InlineObjectPreferredStretch.js +30 -0
- package/dist/org/tiqian/core/InlineObjectPreferredStretchKind.d.ts +16 -0
- package/dist/org/tiqian/core/InlineObjectPreferredStretchKind.js +17 -0
- package/dist/org/tiqian/core/InlineObjectPunctuationAttachmentDecisionInfo.d.ts +12 -0
- package/dist/org/tiqian/core/InlineObjectPunctuationAttachmentDecisionInfo.js +22 -0
- package/dist/org/tiqian/core/InlineObjectSpan.d.ts +13 -0
- package/dist/org/tiqian/core/InlineObjectSpan.js +22 -0
- package/dist/org/tiqian/core/IntRange.d.ts +12 -0
- package/dist/org/tiqian/core/IntRange.js +30 -0
- package/dist/org/tiqian/core/IntRangeFns.d.ts +2 -0
- package/dist/org/tiqian/core/IntRangeFns.js +4 -0
- package/dist/org/tiqian/core/JustificationAllocationInfo.d.ts +10 -0
- package/dist/org/tiqian/core/JustificationAllocationInfo.js +18 -0
- package/dist/org/tiqian/core/JustificationDecisionInfo.d.ts +10 -0
- package/dist/org/tiqian/core/JustificationDecisionInfo.js +21 -0
- package/dist/org/tiqian/core/KinsokuDecisionInfo.d.ts +8 -0
- package/dist/org/tiqian/core/KinsokuDecisionInfo.js +16 -0
- package/dist/org/tiqian/core/LastLineAlignment.d.ts +16 -0
- package/dist/org/tiqian/core/LastLineAlignment.js +17 -0
- package/dist/org/tiqian/core/LayoutConstraints.d.ts +7 -0
- package/dist/org/tiqian/core/LayoutConstraints.js +24 -0
- package/dist/org/tiqian/core/LayoutDebugInfo.d.ts +70 -0
- package/dist/org/tiqian/core/LayoutDebugInfo.js +205 -0
- package/dist/org/tiqian/core/LayoutInput.d.ts +22 -0
- package/dist/org/tiqian/core/LayoutInput.js +56 -0
- package/dist/org/tiqian/core/LayoutPaintBounds.d.ts +18 -0
- package/dist/org/tiqian/core/LayoutPaintBounds.js +131 -0
- package/dist/org/tiqian/core/LayoutProfileId.d.ts +6 -0
- package/dist/org/tiqian/core/LayoutProfileId.js +17 -0
- package/dist/org/tiqian/core/LayoutQueries.d.ts +121 -0
- package/dist/org/tiqian/core/LayoutQueries.js +1297 -0
- package/dist/org/tiqian/core/LayoutQueryFns.d.ts +27 -0
- package/dist/org/tiqian/core/LayoutQueryFns.js +65 -0
- package/dist/org/tiqian/core/LayoutResult.d.ts +16 -0
- package/dist/org/tiqian/core/LayoutResult.js +36 -0
- package/dist/org/tiqian/core/LayoutResultFns.d.ts +3 -0
- package/dist/org/tiqian/core/LayoutResultFns.js +5 -0
- package/dist/org/tiqian/core/LayoutResultLineFns.d.ts +4 -0
- package/dist/org/tiqian/core/LayoutResultLineFns.js +5 -0
- package/dist/org/tiqian/core/LayoutResultReplayIndex.d.ts +37 -0
- package/dist/org/tiqian/core/LayoutResultReplayIndex.js +379 -0
- package/dist/org/tiqian/core/LineBox.d.ts +23 -0
- package/dist/org/tiqian/core/LineBox.js +43 -0
- package/dist/org/tiqian/core/LineBreakPolicy.d.ts +8 -0
- package/dist/org/tiqian/core/LineBreakPolicy.js +11 -0
- package/dist/org/tiqian/core/LineBreakSpan.d.ts +10 -0
- package/dist/org/tiqian/core/LineBreakSpan.js +30 -0
- package/dist/org/tiqian/core/LineDebugInfo.d.ts +7 -0
- package/dist/org/tiqian/core/LineDebugInfo.js +18 -0
- package/dist/org/tiqian/core/LineDecisionInfo.d.ts +14 -0
- package/dist/org/tiqian/core/LineDecisionInfo.js +32 -0
- package/dist/org/tiqian/core/LineEdgeTrimDecisionInfo.d.ts +12 -0
- package/dist/org/tiqian/core/LineEdgeTrimDecisionInfo.js +22 -0
- package/dist/org/tiqian/core/LineEndReason.d.ts +16 -0
- package/dist/org/tiqian/core/LineEndReason.js +17 -0
- package/dist/org/tiqian/core/LineLengthGrid.d.ts +7 -0
- package/dist/org/tiqian/core/LineLengthGrid.js +12 -0
- package/dist/org/tiqian/core/LineLengthGridDecisionInfo.d.ts +13 -0
- package/dist/org/tiqian/core/LineLengthGridDecisionInfo.js +26 -0
- package/dist/org/tiqian/core/LineRepairAllocationInfo.d.ts +8 -0
- package/dist/org/tiqian/core/LineRepairAllocationInfo.js +14 -0
- package/dist/org/tiqian/core/LineRepairCandidateInfo.d.ts +16 -0
- package/dist/org/tiqian/core/LineRepairCandidateInfo.js +30 -0
- package/dist/org/tiqian/core/LineRepairDecisionInfo.d.ts +15 -0
- package/dist/org/tiqian/core/LineRepairDecisionInfo.js +31 -0
- package/dist/org/tiqian/core/LineSpacingDecisionInfo.d.ts +10 -0
- package/dist/org/tiqian/core/LineSpacingDecisionInfo.js +20 -0
- package/dist/org/tiqian/core/LinkAddressDisplay.d.ts +3 -0
- package/dist/org/tiqian/core/LinkAddressDisplay.js +12 -0
- package/dist/org/tiqian/core/MandatoryBreakDecisionInfo.d.ts +10 -0
- package/dist/org/tiqian/core/MandatoryBreakDecisionInfo.js +33 -0
- package/dist/org/tiqian/core/MaxLinesDecisionInfo.d.ts +8 -0
- package/dist/org/tiqian/core/MaxLinesDecisionInfo.js +25 -0
- package/dist/org/tiqian/core/MeasureAdaptiveFirstLineIndent.d.ts +8 -0
- package/dist/org/tiqian/core/MeasureAdaptiveFirstLineIndent.js +17 -0
- package/dist/org/tiqian/core/MetricDecisionInfo.d.ts +19 -0
- package/dist/org/tiqian/core/MetricDecisionInfo.js +36 -0
- package/dist/org/tiqian/core/ParagraphStyle.d.ts +22 -0
- package/dist/org/tiqian/core/ParagraphStyle.js +36 -0
- package/dist/org/tiqian/core/PositionedCluster.d.ts +22 -0
- package/dist/org/tiqian/core/PositionedCluster.js +52 -0
- package/dist/org/tiqian/core/PunctuationDecisionInfo.d.ts +29 -0
- package/dist/org/tiqian/core/PunctuationDecisionInfo.js +54 -0
- package/dist/org/tiqian/core/Rect.d.ts +12 -0
- package/dist/org/tiqian/core/Rect.js +28 -0
- package/dist/org/tiqian/core/RichTextBackgroundDrawStyle.d.ts +15 -0
- package/dist/org/tiqian/core/RichTextBackgroundDrawStyle.js +25 -0
- package/dist/org/tiqian/core/RichTextBackgroundMetricPolicy.d.ts +16 -0
- package/dist/org/tiqian/core/RichTextBackgroundMetricPolicy.js +17 -0
- package/dist/org/tiqian/core/RichTextBackgroundPaint.d.ts +19 -0
- package/dist/org/tiqian/core/RichTextBackgroundPaint.js +51 -0
- package/dist/org/tiqian/core/RichTextCornerRadii.d.ts +12 -0
- package/dist/org/tiqian/core/RichTextCornerRadii.js +28 -0
- package/dist/org/tiqian/core/RichTextLayoutProjection.d.ts +6 -0
- package/dist/org/tiqian/core/RichTextLayoutProjection.js +62 -0
- package/dist/org/tiqian/core/RichTextLinePattern.d.ts +24 -0
- package/dist/org/tiqian/core/RichTextLinePattern.js +46 -0
- package/dist/org/tiqian/core/RichTextLineSegment.d.ts +25 -0
- package/dist/org/tiqian/core/RichTextLineSegment.js +55 -0
- package/dist/org/tiqian/core/RichTextPaint.d.ts +17 -0
- package/dist/org/tiqian/core/RichTextPaint.js +64 -0
- package/dist/org/tiqian/core/RichTextProjectionFns.d.ts +7 -0
- package/dist/org/tiqian/core/RichTextProjectionFns.js +102 -0
- package/dist/org/tiqian/core/RichTextRole.d.ts +35 -0
- package/dist/org/tiqian/core/RichTextRole.js +57 -0
- package/dist/org/tiqian/core/RichTextSpan.d.ts +11 -0
- package/dist/org/tiqian/core/RichTextSpan.js +34 -0
- package/dist/org/tiqian/core/RoleOverrideInfo.d.ts +12 -0
- package/dist/org/tiqian/core/RoleOverrideInfo.js +41 -0
- package/dist/org/tiqian/core/RubyDecisionInfo.d.ts +20 -0
- package/dist/org/tiqian/core/RubyDecisionInfo.js +46 -0
- package/dist/org/tiqian/core/RubyKind.d.ts +12 -0
- package/dist/org/tiqian/core/RubyKind.js +14 -0
- package/dist/org/tiqian/core/RubyLineHeightDecisionInfo.d.ts +13 -0
- package/dist/org/tiqian/core/RubyLineHeightDecisionInfo.js +36 -0
- package/dist/org/tiqian/core/RubyLineHeightMode.d.ts +12 -0
- package/dist/org/tiqian/core/RubyLineHeightMode.js +14 -0
- package/dist/org/tiqian/core/RubySpan.d.ts +13 -0
- package/dist/org/tiqian/core/RubySpan.js +60 -0
- package/dist/org/tiqian/core/ShapingDecisionInfo.d.ts +21 -0
- package/dist/org/tiqian/core/ShapingDecisionInfo.js +40 -0
- package/dist/org/tiqian/core/Size.d.ts +6 -0
- package/dist/org/tiqian/core/Size.js +12 -0
- package/dist/org/tiqian/core/SourceBoundaryBias.d.ts +16 -0
- package/dist/org/tiqian/core/SourceBoundaryBias.js +17 -0
- package/dist/org/tiqian/core/SourceInteractionBoundaries.d.ts +29 -0
- package/dist/org/tiqian/core/SourceInteractionBoundaries.js +193 -0
- package/dist/org/tiqian/core/SpacingDecisionInfo.d.ts +13 -0
- package/dist/org/tiqian/core/SpacingDecisionInfo.js +24 -0
- package/dist/org/tiqian/core/TextRange.d.ts +11 -0
- package/dist/org/tiqian/core/TextRange.js +40 -0
- package/dist/org/tiqian/core/TextRangeError.d.ts +11 -0
- package/dist/org/tiqian/core/TextRangeError.js +2 -0
- package/dist/org/tiqian/core/TextSpan.d.ts +8 -0
- package/dist/org/tiqian/core/TextSpan.js +12 -0
- package/dist/org/tiqian/core/TextStyle.d.ts +12 -0
- package/dist/org/tiqian/core/TextStyle.js +28 -0
- package/dist/org/tiqian/core/TiqianIllegalArgumentException.d.ts +6 -0
- package/dist/org/tiqian/core/TiqianIllegalArgumentException.js +21 -0
- package/dist/org/tiqian/core/TiqianNoSuchElementException.d.ts +10 -0
- package/dist/org/tiqian/core/TiqianNoSuchElementException.js +16 -0
- package/dist/org/tiqian/core/TiqianTextContent.d.ts +12 -0
- package/dist/org/tiqian/core/TiqianTextContent.js +38 -0
- package/dist/org/tiqian/core/UnicodeCombiningMarkData.d.ts +3 -0
- package/dist/org/tiqian/core/UnicodeCombiningMarkData.js +109 -0
- package/dist/org/tiqian/core/UnicodeEastAsianSpacing.d.ts +16 -0
- package/dist/org/tiqian/core/UnicodeEastAsianSpacing.js +88 -0
- package/dist/org/tiqian/core/UnicodeEmojiModifierBaseData.d.ts +3 -0
- package/dist/org/tiqian/core/UnicodeEmojiModifierBaseData.js +35 -0
- package/dist/org/tiqian/core/UnicodeExtendedPictographicData.d.ts +3 -0
- package/dist/org/tiqian/core/UnicodeExtendedPictographicData.js +64 -0
- package/dist/org/tiqian/core/UnicodeNumber.d.ts +3 -0
- package/dist/org/tiqian/core/UnicodeNumber.js +14 -0
- package/dist/org/tiqian/core/UnicodeNumberData.d.ts +3 -0
- package/dist/org/tiqian/core/UnicodeNumberData.js +64 -0
- package/dist/org/tiqian/core/UnicodeScriptEvidence.d.ts +16 -0
- package/dist/org/tiqian/core/UnicodeScriptEvidence.js +17 -0
- package/dist/org/tiqian/core/UnicodeScriptEvidenceClassifier.d.ts +7 -0
- package/dist/org/tiqian/core/UnicodeScriptEvidenceClassifier.js +17 -0
- package/dist/org/tiqian/core/UnicodeScriptEvidenceData.d.ts +4 -0
- package/dist/org/tiqian/core/UnicodeScriptEvidenceData.js +295 -0
- package/dist/org/tiqian/core/UnicodeWordCharacter.d.ts +6 -0
- package/dist/org/tiqian/core/UnicodeWordCharacter.js +17 -0
- package/dist/org/tiqian/core/UnicodeWordCharacterData.d.ts +3 -0
- package/dist/org/tiqian/core/UnicodeWordCharacterData.js +234 -0
- package/dist/org/tiqian/core/Units.d.ts +7 -0
- package/dist/org/tiqian/core/Units.js +11 -0
- package/dist/org/tiqian/core/WritingMode.d.ts +12 -0
- package/dist/org/tiqian/core/WritingMode.js +14 -0
- package/dist/org/tiqian/core/ZeroWidthBreakDecisionInfo.d.ts +10 -0
- package/dist/org/tiqian/core/ZeroWidthBreakDecisionInfo.js +33 -0
- package/dist/org/tiqian/font/BaselineClass.d.ts +24 -0
- package/dist/org/tiqian/font/BaselineClass.js +23 -0
- package/dist/org/tiqian/font/BaselinePolicy.d.ts +17 -0
- package/dist/org/tiqian/font/BaselinePolicy.js +18 -0
- package/dist/org/tiqian/font/CjkDashCapabilityPolicy.d.ts +4 -0
- package/dist/org/tiqian/font/CjkDashCapabilityPolicy.js +9 -0
- package/dist/org/tiqian/font/CjkFontRoleClassifier.d.ts +8 -0
- package/dist/org/tiqian/font/CjkFontRoleClassifier.js +43 -0
- package/dist/org/tiqian/font/FontMetricSource.d.ts +24 -0
- package/dist/org/tiqian/font/FontMetricSource.js +23 -0
- package/dist/org/tiqian/font/FontMetrics.d.ts +39 -0
- package/dist/org/tiqian/font/FontMetrics.js +106 -0
- package/dist/org/tiqian/font/FontMetricsPolicy.d.ts +21 -0
- package/dist/org/tiqian/font/FontMetricsPolicy.js +21 -0
- package/dist/org/tiqian/font/FontPolicy.d.ts +36 -0
- package/dist/org/tiqian/font/FontPolicy.js +157 -0
- package/dist/org/tiqian/font/FontRole.d.ts +29 -0
- package/dist/org/tiqian/font/FontRole.js +27 -0
- package/dist/org/tiqian/font/FontRoleContext.d.ts +13 -0
- package/dist/org/tiqian/font/FontRoleContext.js +28 -0
- package/dist/org/tiqian/font/InlineShapingStylePolicy.d.ts +4 -0
- package/dist/org/tiqian/font/InlineShapingStylePolicy.js +18 -0
- package/dist/org/tiqian/font/LayoutFontMetrics.d.ts +18 -0
- package/dist/org/tiqian/font/LayoutFontMetrics.js +29 -0
- package/dist/org/tiqian/font/MetricBox.d.ts +20 -0
- package/dist/org/tiqian/font/MetricBox.js +20 -0
- package/dist/org/tiqian/font/PreferCjkForAmbiguousPunctuationResolver.d.ts +10 -0
- package/dist/org/tiqian/font/PreferCjkForAmbiguousPunctuationResolver.js +30 -0
- package/dist/org/tiqian/font/PunctuationFontPolicy.d.ts +21 -0
- package/dist/org/tiqian/font/PunctuationFontPolicy.js +21 -0
- package/dist/org/tiqian/font/RawFontMetrics.d.ts +11 -0
- package/dist/org/tiqian/font/RawFontMetrics.js +23 -0
- package/dist/org/tiqian/font/UnicodeEmojiData.d.ts +3 -0
- package/dist/org/tiqian/font/UnicodeEmojiData.js +63 -0
- package/dist/org/tiqian/font/UnicodeEmojiPresentationData.d.ts +3 -0
- package/dist/org/tiqian/font/UnicodeEmojiPresentationData.js +46 -0
- package/dist/org/tiqian/font/UnicodeEmojiStyleVariationData.d.ts +3 -0
- package/dist/org/tiqian/font/UnicodeEmojiStyleVariationData.js +71 -0
- package/dist/org/tiqian/font/UnicodeSymbolData.d.ts +3 -0
- package/dist/org/tiqian/font/UnicodeSymbolData.js +88 -0
- package/dist/org/tiqian/layout/AnnotationGeometryStage.d.ts +57 -0
- package/dist/org/tiqian/layout/AnnotationGeometryStage.js +622 -0
- package/dist/org/tiqian/layout/AsciiPointMarkKinsokuTestSupport.d.ts +52 -0
- package/dist/org/tiqian/layout/AsciiPointMarkKinsokuTestSupport.js +209 -0
- package/dist/org/tiqian/layout/ClusterRoleResolution.d.ts +30 -0
- package/dist/org/tiqian/layout/ClusterRoleResolution.js +215 -0
- package/dist/org/tiqian/layout/ContextualDashEllipsisRoleResolver.d.ts +54 -0
- package/dist/org/tiqian/layout/ContextualDashEllipsisRoleResolver.js +326 -0
- package/dist/org/tiqian/layout/ContextualPunctuationDisplaySubstitution.d.ts +6 -0
- package/dist/org/tiqian/layout/ContextualPunctuationDisplaySubstitution.js +8 -0
- package/dist/org/tiqian/layout/ContextualQuoteRoleResolver.d.ts +51 -0
- package/dist/org/tiqian/layout/ContextualQuoteRoleResolver.js +305 -0
- package/dist/org/tiqian/layout/DefaultHyphenator.d.ts +4 -0
- package/dist/org/tiqian/layout/DefaultHyphenator.js +7 -0
- package/dist/org/tiqian/layout/Justifier.d.ts +64 -0
- package/dist/org/tiqian/layout/Justifier.js +474 -0
- package/dist/org/tiqian/layout/KinsokuRule.d.ts +15 -0
- package/dist/org/tiqian/layout/KinsokuRule.js +24 -0
- package/dist/org/tiqian/layout/LayoutDebugAssembly.d.ts +87 -0
- package/dist/org/tiqian/layout/LayoutDebugAssembly.js +371 -0
- package/dist/org/tiqian/layout/LineAdjustmentStage.d.ts +29 -0
- package/dist/org/tiqian/layout/LineAdjustmentStage.js +797 -0
- package/dist/org/tiqian/layout/LineBreakPlanningStage.d.ts +149 -0
- package/dist/org/tiqian/layout/LineBreakPlanningStage.js +769 -0
- package/dist/org/tiqian/layout/LineBreaker.d.ts +54 -0
- package/dist/org/tiqian/layout/LineBreaker.js +457 -0
- package/dist/org/tiqian/layout/LineGeometryStage.d.ts +63 -0
- package/dist/org/tiqian/layout/LineGeometryStage.js +344 -0
- package/dist/org/tiqian/layout/LineOptimization.d.ts +125 -0
- package/dist/org/tiqian/layout/LineOptimization.js +299 -0
- package/dist/org/tiqian/layout/LineRepair.d.ts +30 -0
- package/dist/org/tiqian/layout/LineRepair.js +471 -0
- package/dist/org/tiqian/layout/ParagraphDpLineBreaker.d.ts +80 -0
- package/dist/org/tiqian/layout/ParagraphDpLineBreaker.js +556 -0
- package/dist/org/tiqian/layout/ParagraphDpLineBreakerTestSupport.d.ts +23 -0
- package/dist/org/tiqian/layout/ParagraphDpLineBreakerTestSupport.js +135 -0
- package/dist/org/tiqian/layout/ParagraphLayoutEngine.d.ts +48 -0
- package/dist/org/tiqian/layout/ParagraphLayoutEngine.js +199 -0
- package/dist/org/tiqian/layout/ParagraphShapingStage.d.ts +63 -0
- package/dist/org/tiqian/layout/ParagraphShapingStage.js +1471 -0
- package/dist/org/tiqian/layout/PlanLowering.d.ts +10 -0
- package/dist/org/tiqian/layout/PlanLowering.js +329 -0
- package/dist/org/tiqian/layout/PreparedParagraph.d.ts +32 -0
- package/dist/org/tiqian/layout/PreparedParagraph.js +114 -0
- package/dist/org/tiqian/layout/ProgressiveBreakDecisions.d.ts +86 -0
- package/dist/org/tiqian/layout/ProgressiveBreakDecisions.js +415 -0
- package/dist/org/tiqian/layout/ProgressiveBreakTierPriority.d.ts +5 -0
- package/dist/org/tiqian/layout/ProgressiveBreakTierPriority.js +33 -0
- package/dist/org/tiqian/layout/PunctuationGeometryLedger.d.ts +92 -0
- package/dist/org/tiqian/layout/PunctuationGeometryLedger.js +617 -0
- package/dist/org/tiqian/layout/PunctuationGeometryStage.d.ts +73 -0
- package/dist/org/tiqian/layout/PunctuationGeometryStage.js +631 -0
- package/dist/org/tiqian/layout/PunctuationModel.d.ts +181 -0
- package/dist/org/tiqian/layout/PunctuationModel.js +414 -0
- package/dist/org/tiqian/layout/QuotePairAnalyzer.d.ts +63 -0
- package/dist/org/tiqian/layout/QuotePairAnalyzer.js +251 -0
- package/dist/org/tiqian/layout/UnicodePunctuationBoundaryResolver.d.ts +88 -0
- package/dist/org/tiqian/layout/UnicodePunctuationBoundaryResolver.js +495 -0
- package/dist/org/tiqian/layout/WidthIndependentAnnotationCache.d.ts +102 -0
- package/dist/org/tiqian/layout/WidthIndependentAnnotationCache.js +1207 -0
- package/dist/org/tiqian/linebreak/BreakKind.d.ts +20 -0
- package/dist/org/tiqian/linebreak/BreakKind.js +20 -0
- package/dist/org/tiqian/linebreak/BreakOpportunity.d.ts +19 -0
- package/dist/org/tiqian/linebreak/BreakOpportunity.js +64 -0
- package/dist/org/tiqian/linebreak/EnglishHyphenation.d.ts +5 -0
- package/dist/org/tiqian/linebreak/EnglishHyphenation.js +14 -0
- package/dist/org/tiqian/linebreak/EnglishHyphenationPatterns.d.ts +4 -0
- package/dist/org/tiqian/linebreak/EnglishHyphenationPatterns.js +4294 -0
- package/dist/org/tiqian/linebreak/Hyphenator.d.ts +17 -0
- package/dist/org/tiqian/linebreak/Hyphenator.js +24 -0
- package/dist/org/tiqian/linebreak/LiangHyphenator.d.ts +10 -0
- package/dist/org/tiqian/linebreak/LiangHyphenator.js +67 -0
- package/dist/org/tiqian/linebreak/LineBreakAnalyzer.d.ts +9 -0
- package/dist/org/tiqian/linebreak/LineBreakAnalyzer.js +23 -0
- package/dist/org/tiqian/linebreak/LineBreakFns.d.ts +2 -0
- package/dist/org/tiqian/linebreak/LineBreakFns.js +7 -0
- package/dist/org/tiqian/linebreak/ParseTexHyphenationPatterns.d.ts +7 -0
- package/dist/org/tiqian/linebreak/ParseTexHyphenationPatterns.js +108 -0
- package/dist/org/tiqian/linebreak/ParsedTexHyphenation.d.ts +6 -0
- package/dist/org/tiqian/linebreak/ParsedTexHyphenation.js +9 -0
- package/dist/org/tiqian/linebreak/UnicodePunctuationLineBreak.d.ts +63 -0
- package/dist/org/tiqian/linebreak/UnicodePunctuationLineBreak.js +103 -0
- package/dist/org/tiqian/linebreak/UnicodePunctuationLineBreakData.d.ts +3 -0
- package/dist/org/tiqian/linebreak/UnicodePunctuationLineBreakData.js +164 -0
- package/dist/org/tiqian/protocol/NamedError.d.ts +88 -0
- package/dist/org/tiqian/protocol/NamedError.js +71 -0
- package/dist/org/tiqian/protocol/NamedErrorNames.d.ts +5 -0
- package/dist/org/tiqian/protocol/NamedErrorNames.js +53 -0
- package/dist/org/tiqian/protocol/Plan.d.ts +101 -0
- package/dist/org/tiqian/protocol/Plan.js +10 -0
- package/dist/org/tiqian/protocol/PlanEndReason.d.ts +16 -0
- package/dist/org/tiqian/protocol/PlanEndReason.js +17 -0
- package/dist/org/tiqian/protocol/PlanJson.d.ts +10 -0
- package/dist/org/tiqian/protocol/PlanJson.js +442 -0
- package/dist/org/tiqian/protocol/PlanJsonNumber.d.ts +43 -0
- package/dist/org/tiqian/protocol/PlanJsonNumber.js +362 -0
- package/dist/org/tiqian/protocol/PlanPacked.d.ts +34 -0
- package/dist/org/tiqian/protocol/PlanPacked.js +1166 -0
- package/dist/org/tiqian/protocol/PlanSchema.d.ts +4 -0
- package/dist/org/tiqian/protocol/PlanSchema.js +5 -0
- package/dist/org/tiqian/protocol/PlanStyleDelta.d.ts +5 -0
- package/dist/org/tiqian/protocol/PlanStyleDelta.js +2 -0
- package/dist/org/tiqian/shaping/ReplayableFontBackend.d.ts +48 -0
- package/dist/org/tiqian/shaping/ReplayableFontBackend.js +97 -0
- package/dist/org/tiqian/shaping/TextShaper.d.ts +71 -0
- package/dist/org/tiqian/shaping/TextShaper.js +176 -0
- package/dist/org/tiqian/test/TestHelpers.d.ts +5 -0
- package/dist/org/tiqian/test/TestHelpers.js +27 -0
- package/dist/org/tiqian/test/trace/TestTrace.d.ts +6 -0
- package/dist/org/tiqian/test/trace/TestTrace.js +8 -0
- package/dist/org/tiqian/test/trace/TestTracePlatform.d.ts +6 -0
- package/dist/org/tiqian/test/trace/TestTracePlatform.js +78 -0
- package/dist/org/tiqian/test/trace/TestTraceRecorder.d.ts +9 -0
- package/dist/org/tiqian/test/trace/TestTraceRecorder.js +36 -0
- package/dist/org/tiqian/test/trace/TestTraceRender.d.ts +47 -0
- package/dist/org/tiqian/test/trace/TestTraceRender.js +690 -0
- package/dist/org/tiqian/test/trace/TestTraceStore.d.ts +18 -0
- package/dist/org/tiqian/test/trace/TestTraceStore.js +149 -0
- package/dist/org/tiqian/test/trace/TraceAssertionError.d.ts +5 -0
- package/dist/org/tiqian/test/trace/TraceAssertionError.js +2 -0
- package/dist/org/tiqian/test/trace/TraceAssertionException.d.ts +6 -0
- package/dist/org/tiqian/test/trace/TraceAssertionException.js +16 -0
- package/dist/org/tiqian/test/trace/TraceField.d.ts +5 -0
- package/dist/org/tiqian/test/trace/TraceField.js +10 -0
- package/dist/org/tiqian/test/trace/TraceFormat.d.ts +21 -0
- package/dist/org/tiqian/test/trace/TraceFormat.js +184 -0
- package/dist/org/tiqian/test/trace/TracedAssertions.d.ts +78 -0
- package/dist/org/tiqian/test/trace/TracedAssertions.js +749 -0
- package/dist/runtime.d.ts +96 -0
- package/dist/runtime.js +1612 -0
- package/dist/std/FsError.d.ts +48 -0
- package/dist/std/FsError.js +2 -0
- package/dist/std/FsException.d.ts +6 -0
- package/dist/std/FsException.js +45 -0
- package/dist/std/UStringException.d.ts +6 -0
- package/dist/std/UStringException.js +21 -0
- package/dist/std/UStringFault.d.ts +9 -0
- package/dist/std/UStringFault.js +2 -0
- package/package.json +22 -4
- package/README.md +0 -3
|
@@ -0,0 +1,495 @@
|
|
|
1
|
+
// Generated by the reflaxe TypeScript target. Do not edit.
|
|
2
|
+
import { ContextualKinsokuDecisionInfo } from "./../core/ContextualKinsokuDecisionInfo.js";
|
|
3
|
+
import { IntRange } from "./../core/IntRange.js";
|
|
4
|
+
import { TiqianIllegalArgumentException } from "./../core/TiqianIllegalArgumentException.js";
|
|
5
|
+
import { isMandatoryBreakCodePoint, isZeroWidthSpaceCodePoint } from "./../linebreak/LineBreakFns.js";
|
|
6
|
+
import { UnicodePunctuationLineBreak } from "./../linebreak/UnicodePunctuationLineBreak.js";
|
|
7
|
+
import { SortedTable, readUnit } from "../../../runtime.js";
|
|
8
|
+
export class SignificantCodePoint {
|
|
9
|
+
offset;
|
|
10
|
+
codePoint;
|
|
11
|
+
constructor(offset, codePoint) {
|
|
12
|
+
this.offset = offset;
|
|
13
|
+
this.codePoint = codePoint;
|
|
14
|
+
}
|
|
15
|
+
toString() {
|
|
16
|
+
return `SignificantCodePoint(offset=${this.offset}, codePoint=${this.codePoint})`;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
export function compareSignificantCodePoint(a, b) {
|
|
20
|
+
if (a === b)
|
|
21
|
+
return 0;
|
|
22
|
+
if (a.offset !== b.offset)
|
|
23
|
+
return a.offset - b.offset;
|
|
24
|
+
if (a.codePoint !== b.codePoint)
|
|
25
|
+
return a.codePoint - b.codePoint;
|
|
26
|
+
return 0;
|
|
27
|
+
}
|
|
28
|
+
export class UnicodePunctuationBoundaries {
|
|
29
|
+
forbiddenLineStartClusters;
|
|
30
|
+
forbiddenLineEndClusters;
|
|
31
|
+
unbreakableRanges;
|
|
32
|
+
decisions;
|
|
33
|
+
constructor(forbiddenLineStartClusters, forbiddenLineEndClusters, unbreakableRanges, decisions) {
|
|
34
|
+
this.forbiddenLineStartClusters = forbiddenLineStartClusters;
|
|
35
|
+
this.forbiddenLineEndClusters = forbiddenLineEndClusters;
|
|
36
|
+
this.unbreakableRanges = unbreakableRanges;
|
|
37
|
+
this.decisions = decisions;
|
|
38
|
+
}
|
|
39
|
+
toString() {
|
|
40
|
+
return `UnicodePunctuationBoundaries(forbiddenLineStartClusters=${(() => { let out = "["; const n = this.forbiddenLineStartClusters.size(); for (let i = 0; i < n; i += 1) {
|
|
41
|
+
if (i > 0) {
|
|
42
|
+
out += ", ";
|
|
43
|
+
}
|
|
44
|
+
out += this.forbiddenLineStartClusters.at(i);
|
|
45
|
+
} out += "]"; return out; })()}, forbiddenLineEndClusters=${(() => { let out = "["; const n = this.forbiddenLineEndClusters.size(); for (let i = 0; i < n; i += 1) {
|
|
46
|
+
if (i > 0) {
|
|
47
|
+
out += ", ";
|
|
48
|
+
}
|
|
49
|
+
out += this.forbiddenLineEndClusters.at(i);
|
|
50
|
+
} out += "]"; return out; })()}, unbreakableRanges=${(() => { let out = "["; const n = this.unbreakableRanges.length; for (let i = 0; i < n; i += 1) {
|
|
51
|
+
if (i > 0) {
|
|
52
|
+
out += ", ";
|
|
53
|
+
}
|
|
54
|
+
out += this.unbreakableRanges[i].toString();
|
|
55
|
+
} out += "]"; return out; })()}, decisions=${(() => { let out = "["; const n = this.decisions.length; for (let i = 0; i < n; i += 1) {
|
|
56
|
+
if (i > 0) {
|
|
57
|
+
out += ", ";
|
|
58
|
+
}
|
|
59
|
+
out += this.decisions[i].toString();
|
|
60
|
+
} out += "]"; return out; })()})`;
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
export class AttachedInlineVirtualBoundary {
|
|
64
|
+
previousClusterIndex;
|
|
65
|
+
attachedClusterRange;
|
|
66
|
+
nextClusterIndex;
|
|
67
|
+
constructor(previousClusterIndex, attachedClusterRange, nextClusterIndex) {
|
|
68
|
+
this.previousClusterIndex = previousClusterIndex;
|
|
69
|
+
this.attachedClusterRange = attachedClusterRange;
|
|
70
|
+
this.nextClusterIndex = nextClusterIndex;
|
|
71
|
+
}
|
|
72
|
+
toString() {
|
|
73
|
+
return `AttachedInlineVirtualBoundary(previousClusterIndex=${this.previousClusterIndex}, attachedClusterRange=${this.attachedClusterRange.toString()}, nextClusterIndex=${this.nextClusterIndex})`;
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
export class AttachedInlineInterCharBoundaries {
|
|
77
|
+
ordinaryWesternBoundaryAfterClusters;
|
|
78
|
+
suppressedPhysicalBoundaryAfterClusters;
|
|
79
|
+
virtualBoundaryAfterClusters;
|
|
80
|
+
virtualSinoWesternBoundaryAfterClusters;
|
|
81
|
+
constructor(ordinaryWesternBoundaryAfterClusters, suppressedPhysicalBoundaryAfterClusters, virtualBoundaryAfterClusters, virtualSinoWesternBoundaryAfterClusters) {
|
|
82
|
+
this.ordinaryWesternBoundaryAfterClusters = ordinaryWesternBoundaryAfterClusters;
|
|
83
|
+
this.suppressedPhysicalBoundaryAfterClusters = suppressedPhysicalBoundaryAfterClusters;
|
|
84
|
+
this.virtualBoundaryAfterClusters = virtualBoundaryAfterClusters;
|
|
85
|
+
this.virtualSinoWesternBoundaryAfterClusters = virtualSinoWesternBoundaryAfterClusters;
|
|
86
|
+
}
|
|
87
|
+
toString() {
|
|
88
|
+
return `AttachedInlineInterCharBoundaries(ordinaryWesternBoundaryAfterClusters=${(() => { let out = "["; const n = this.ordinaryWesternBoundaryAfterClusters.size(); for (let i = 0; i < n; i += 1) {
|
|
89
|
+
if (i > 0) {
|
|
90
|
+
out += ", ";
|
|
91
|
+
}
|
|
92
|
+
out += this.ordinaryWesternBoundaryAfterClusters.at(i);
|
|
93
|
+
} out += "]"; return out; })()}, suppressedPhysicalBoundaryAfterClusters=${(() => { let out = "["; const n = this.suppressedPhysicalBoundaryAfterClusters.size(); for (let i = 0; i < n; i += 1) {
|
|
94
|
+
if (i > 0) {
|
|
95
|
+
out += ", ";
|
|
96
|
+
}
|
|
97
|
+
out += this.suppressedPhysicalBoundaryAfterClusters.at(i);
|
|
98
|
+
} out += "]"; return out; })()}, virtualBoundaryAfterClusters=${(() => { let out = "{"; const n = this.virtualBoundaryAfterClusters.size(); for (let i = 0; i < n; i += 1) {
|
|
99
|
+
if (i > 0) {
|
|
100
|
+
out += ", ";
|
|
101
|
+
}
|
|
102
|
+
out += this.virtualBoundaryAfterClusters.keyAt(i) + "=" + this.virtualBoundaryAfterClusters.valueAt(i);
|
|
103
|
+
} out += "}"; return out; })()}, virtualSinoWesternBoundaryAfterClusters=${(() => { let out = "["; const n = this.virtualSinoWesternBoundaryAfterClusters.size(); for (let i = 0; i < n; i += 1) {
|
|
104
|
+
if (i > 0) {
|
|
105
|
+
out += ", ";
|
|
106
|
+
}
|
|
107
|
+
out += this.virtualSinoWesternBoundaryAfterClusters.at(i);
|
|
108
|
+
} out += "]"; return out; })()})`;
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
export function compareAttachedInlineInterCharBoundaries(a, b) {
|
|
112
|
+
if (a === b)
|
|
113
|
+
return 0;
|
|
114
|
+
for (let i0 = 0, n0 = a.ordinaryWesternBoundaryAfterClusters.size() < b.ordinaryWesternBoundaryAfterClusters.size() ? a.ordinaryWesternBoundaryAfterClusters.size() : b.ordinaryWesternBoundaryAfterClusters.size(); i0 < n0; i0++) {
|
|
115
|
+
if (a.ordinaryWesternBoundaryAfterClusters.at(i0) !== b.ordinaryWesternBoundaryAfterClusters.at(i0))
|
|
116
|
+
return a.ordinaryWesternBoundaryAfterClusters.at(i0) - b.ordinaryWesternBoundaryAfterClusters.at(i0);
|
|
117
|
+
}
|
|
118
|
+
if (a.ordinaryWesternBoundaryAfterClusters.size() !== b.ordinaryWesternBoundaryAfterClusters.size())
|
|
119
|
+
return a.ordinaryWesternBoundaryAfterClusters.size() - b.ordinaryWesternBoundaryAfterClusters.size();
|
|
120
|
+
for (let i0 = 0, n0 = a.suppressedPhysicalBoundaryAfterClusters.size() < b.suppressedPhysicalBoundaryAfterClusters.size() ? a.suppressedPhysicalBoundaryAfterClusters.size() : b.suppressedPhysicalBoundaryAfterClusters.size(); i0 < n0; i0++) {
|
|
121
|
+
if (a.suppressedPhysicalBoundaryAfterClusters.at(i0) !== b.suppressedPhysicalBoundaryAfterClusters.at(i0))
|
|
122
|
+
return a.suppressedPhysicalBoundaryAfterClusters.at(i0) - b.suppressedPhysicalBoundaryAfterClusters.at(i0);
|
|
123
|
+
}
|
|
124
|
+
if (a.suppressedPhysicalBoundaryAfterClusters.size() !== b.suppressedPhysicalBoundaryAfterClusters.size())
|
|
125
|
+
return a.suppressedPhysicalBoundaryAfterClusters.size() - b.suppressedPhysicalBoundaryAfterClusters.size();
|
|
126
|
+
for (let i0 = 0, n0 = a.virtualBoundaryAfterClusters.size() < b.virtualBoundaryAfterClusters.size() ? a.virtualBoundaryAfterClusters.size() : b.virtualBoundaryAfterClusters.size(); i0 < n0; i0++) {
|
|
127
|
+
if (a.virtualBoundaryAfterClusters.keyAt(i0) !== b.virtualBoundaryAfterClusters.keyAt(i0))
|
|
128
|
+
return a.virtualBoundaryAfterClusters.keyAt(i0) - b.virtualBoundaryAfterClusters.keyAt(i0);
|
|
129
|
+
if (a.virtualBoundaryAfterClusters.valueAt(i0) !== b.virtualBoundaryAfterClusters.valueAt(i0))
|
|
130
|
+
return a.virtualBoundaryAfterClusters.valueAt(i0) - b.virtualBoundaryAfterClusters.valueAt(i0);
|
|
131
|
+
}
|
|
132
|
+
if (a.virtualBoundaryAfterClusters.size() !== b.virtualBoundaryAfterClusters.size())
|
|
133
|
+
return a.virtualBoundaryAfterClusters.size() - b.virtualBoundaryAfterClusters.size();
|
|
134
|
+
for (let i0 = 0, n0 = a.virtualSinoWesternBoundaryAfterClusters.size() < b.virtualSinoWesternBoundaryAfterClusters.size() ? a.virtualSinoWesternBoundaryAfterClusters.size() : b.virtualSinoWesternBoundaryAfterClusters.size(); i0 < n0; i0++) {
|
|
135
|
+
if (a.virtualSinoWesternBoundaryAfterClusters.at(i0) !== b.virtualSinoWesternBoundaryAfterClusters.at(i0))
|
|
136
|
+
return a.virtualSinoWesternBoundaryAfterClusters.at(i0) - b.virtualSinoWesternBoundaryAfterClusters.at(i0);
|
|
137
|
+
}
|
|
138
|
+
if (a.virtualSinoWesternBoundaryAfterClusters.size() !== b.virtualSinoWesternBoundaryAfterClusters.size())
|
|
139
|
+
return a.virtualSinoWesternBoundaryAfterClusters.size() - b.virtualSinoWesternBoundaryAfterClusters.size();
|
|
140
|
+
return 0;
|
|
141
|
+
}
|
|
142
|
+
export class UnicodePunctuationBoundaryResolver {
|
|
143
|
+
static resolveWesternBracketCjkInterCharBoundaries(text, clusters, roles) {
|
|
144
|
+
const b = SortedTable.setBuilder(SortedTable.compareInts);
|
|
145
|
+
let i = 0;
|
|
146
|
+
while (i + 1 < clusters.length) {
|
|
147
|
+
if (UnicodePunctuationBoundaryResolver.isWesternBracketCjkInterCharBoundary(text, clusters, roles, i, i + 1)) {
|
|
148
|
+
b.put(i);
|
|
149
|
+
}
|
|
150
|
+
i++;
|
|
151
|
+
}
|
|
152
|
+
return b.build();
|
|
153
|
+
}
|
|
154
|
+
static resolveAttachedInlineVirtualBoundaries(a) {
|
|
155
|
+
const r = [];
|
|
156
|
+
let i = 0;
|
|
157
|
+
while (i < a.length) {
|
|
158
|
+
if (a[i].kind !== "Previous") {
|
|
159
|
+
i++;
|
|
160
|
+
continue;
|
|
161
|
+
}
|
|
162
|
+
const s = i;
|
|
163
|
+
let e = s;
|
|
164
|
+
while (e + 1 < a.length && a[e + 1].kind === "Previous") {
|
|
165
|
+
e++;
|
|
166
|
+
}
|
|
167
|
+
if (s > 0) {
|
|
168
|
+
r.push(new AttachedInlineVirtualBoundary(s - 1, new IntRange(s, e), (e + 1 < a.length ? e + 1 : null)));
|
|
169
|
+
}
|
|
170
|
+
i = e + 1;
|
|
171
|
+
}
|
|
172
|
+
return r;
|
|
173
|
+
}
|
|
174
|
+
static resolveAttachedInlineInterCharBoundaries(text, clusters, roles, edges, western, attachments) {
|
|
175
|
+
if (clusters.length !== roles.length || clusters.length !== edges.length) {
|
|
176
|
+
throw new TiqianIllegalArgumentException({ kind: "Message", text: "Clusters, roles and East_Asian_Spacing edges must align." });
|
|
177
|
+
}
|
|
178
|
+
if (clusters.length !== attachments.length) {
|
|
179
|
+
throw new TiqianIllegalArgumentException({ kind: "Message", text: "Inline attachments must align with clusters." });
|
|
180
|
+
}
|
|
181
|
+
const vb = UnicodePunctuationBoundaryResolver.resolveAttachedInlineVirtualBoundaries(attachments);
|
|
182
|
+
const sup = SortedTable.setBuilder(SortedTable.compareInts);
|
|
183
|
+
let i = 0;
|
|
184
|
+
while (i < vb.length) {
|
|
185
|
+
sup.put(vb[i].previousClusterIndex);
|
|
186
|
+
if (vb[i].nextClusterIndex !== null) {
|
|
187
|
+
sup.put(vb[i].attachedClusterRange.end);
|
|
188
|
+
}
|
|
189
|
+
i++;
|
|
190
|
+
}
|
|
191
|
+
const supSet = sup.build();
|
|
192
|
+
const ordinary = SortedTable.setBuilder(SortedTable.compareInts);
|
|
193
|
+
i = 0;
|
|
194
|
+
while (i < western.size()) {
|
|
195
|
+
const x = western.at(i);
|
|
196
|
+
if (!supSet.has(x)) {
|
|
197
|
+
ordinary.put(x);
|
|
198
|
+
}
|
|
199
|
+
i++;
|
|
200
|
+
}
|
|
201
|
+
const vm = SortedTable.mapBuilder(SortedTable.compareInts);
|
|
202
|
+
const vs = SortedTable.setBuilder(SortedTable.compareInts);
|
|
203
|
+
i = 0;
|
|
204
|
+
while (i < vb.length) {
|
|
205
|
+
const q = vb[i];
|
|
206
|
+
i++;
|
|
207
|
+
if (q.nextClusterIndex === null) {
|
|
208
|
+
continue;
|
|
209
|
+
}
|
|
210
|
+
const n = q.nextClusterIndex;
|
|
211
|
+
const p = q.previousClusterIndex;
|
|
212
|
+
const both = UnicodePunctuationBoundaryResolver.isCjk(roles[p]) && UnicodePunctuationBoundaryResolver.isCjk(roles[n]);
|
|
213
|
+
const punct = roles[p].kind === "CjkPunctuation" && edges[n].leading.kind === "Narrow" || edges[p].trailing.kind === "Narrow" && roles[n].kind === "CjkPunctuation";
|
|
214
|
+
const sino = UnicodePunctuationBoundaryResolver.wideNarrow(edges[p].trailing, edges[n].leading);
|
|
215
|
+
const bracket = UnicodePunctuationBoundaryResolver.isWesternBracketCjkInterCharBoundary(text, clusters, roles, p, (n));
|
|
216
|
+
if (both || punct || sino || bracket) {
|
|
217
|
+
vm.put(q.attachedClusterRange.end, p);
|
|
218
|
+
}
|
|
219
|
+
if (sino) {
|
|
220
|
+
vs.put(q.attachedClusterRange.end);
|
|
221
|
+
}
|
|
222
|
+
}
|
|
223
|
+
return new AttachedInlineInterCharBoundaries(ordinary.build(), sup.build(), vm.build(), vs.build());
|
|
224
|
+
}
|
|
225
|
+
static resolveUnicodePunctuationBoundaries(text, clusters, roles, pairs) {
|
|
226
|
+
const opens = SortedTable.setBuilder(SortedTable.compareInts);
|
|
227
|
+
const closes = SortedTable.setBuilder(SortedTable.compareInts);
|
|
228
|
+
let i = 0;
|
|
229
|
+
while (i < pairs.length) {
|
|
230
|
+
opens.put(pairs[i].openIndex);
|
|
231
|
+
closes.put(pairs[i].closeIndex);
|
|
232
|
+
i++;
|
|
233
|
+
}
|
|
234
|
+
const openSet = opens.build();
|
|
235
|
+
const closeSet = closes.build();
|
|
236
|
+
const start = SortedTable.setBuilder(SortedTable.compareInts);
|
|
237
|
+
const end = SortedTable.setBuilder(SortedTable.compareInts);
|
|
238
|
+
const ranges = [];
|
|
239
|
+
const decisions = [];
|
|
240
|
+
i = 0;
|
|
241
|
+
while (i < clusters.length) {
|
|
242
|
+
const c = clusters[i];
|
|
243
|
+
i++;
|
|
244
|
+
const ix = i - 1;
|
|
245
|
+
if (ix >= roles.length || roles[ix].kind === "CjkPunctuation" || c.range.start >= c.range.end) {
|
|
246
|
+
continue;
|
|
247
|
+
}
|
|
248
|
+
const source = text.substring(c.range.start, c.range.end);
|
|
249
|
+
const first = UnicodePunctuationBoundaryResolver.firstSig(source);
|
|
250
|
+
if (first === null) {
|
|
251
|
+
continue;
|
|
252
|
+
}
|
|
253
|
+
const last = UnicodePunctuationBoundaryResolver.lastSig(source);
|
|
254
|
+
if (last === null) {
|
|
255
|
+
continue;
|
|
256
|
+
}
|
|
257
|
+
const fc = UnicodePunctuationLineBreak.classOf(first.codePoint);
|
|
258
|
+
const lc = UnicodePunctuationLineBreak.classOf(last.codePoint);
|
|
259
|
+
const fo = c.range.start + first.offset;
|
|
260
|
+
const lo = c.range.start + last.offset;
|
|
261
|
+
const fdir = UnicodePunctuationBoundaryResolver.quoteDir(text, fo, first.codePoint, fc);
|
|
262
|
+
const ldir = UnicodePunctuationBoundaryResolver.quoteDir(text, lo, last.codePoint, lc);
|
|
263
|
+
const pairedClose = closeSet.has(fo);
|
|
264
|
+
const authored = UnicodePunctuationBoundaryResolver.follows(text, fo);
|
|
265
|
+
const forbidStart = (authored ? false : pairedClose || fdir.kind === "Final" || fdir.kind === "Unresolved" || fc.kind === "InfixNumericSeparator" && !UnicodePunctuationBoundaryResolver.decimalAfterSpace(ix, text, clusters) || UnicodePunctuationBoundaryResolver.forbidClass(fc));
|
|
266
|
+
if (forbidStart) {
|
|
267
|
+
start.put(ix);
|
|
268
|
+
const p = UnicodePunctuationBoundaryResolver.previous(ix, text, clusters);
|
|
269
|
+
if (p !== null) {
|
|
270
|
+
ranges.push(new IntRange((p), ix));
|
|
271
|
+
}
|
|
272
|
+
const reason = (pairedClose ? "Uax14WesternPunctuationBoundary:PairedClosingQuote" : (fdir.kind === "Final" || fdir.kind === "Unresolved" ? "Uax14WesternPunctuationBoundary:LB19" : `Uax14WesternPunctuationBoundary:${UnicodePunctuationBoundaryResolver.rule(fc)}`));
|
|
273
|
+
decisions.push(new ContextualKinsokuDecisionInfo(c.range, source, ix, "LineStart", reason));
|
|
274
|
+
}
|
|
275
|
+
const pairedOpen = openSet.has(lo);
|
|
276
|
+
const forbidEnd = pairedOpen || ldir.kind === "Initial" || ldir.kind === "Unresolved" || lc.kind === "OpenPunctuation";
|
|
277
|
+
if (forbidEnd) {
|
|
278
|
+
end.put(ix);
|
|
279
|
+
const n = UnicodePunctuationBoundaryResolver.next(ix, text, clusters);
|
|
280
|
+
if (n !== null) {
|
|
281
|
+
ranges.push(new IntRange(ix, (n)));
|
|
282
|
+
}
|
|
283
|
+
const reason2 = (pairedOpen ? "Uax14WesternPunctuationBoundary:PairedOpeningQuote" : (ldir.kind === "Initial" || ldir.kind === "Unresolved" ? "Uax14WesternPunctuationBoundary:LB19" : "Uax14WesternPunctuationBoundary:LB14"));
|
|
284
|
+
decisions.push(new ContextualKinsokuDecisionInfo(c.range, source, ix, "LineEnd", reason2));
|
|
285
|
+
}
|
|
286
|
+
}
|
|
287
|
+
return new UnicodePunctuationBoundaries(start.build(), end.build(), UnicodePunctuationBoundaryResolver.distinct(ranges), decisions);
|
|
288
|
+
}
|
|
289
|
+
static isCjk(r) {
|
|
290
|
+
return r.kind === "CjkText" || r.kind === "CjkPunctuation";
|
|
291
|
+
}
|
|
292
|
+
static wideNarrow(a, b) {
|
|
293
|
+
return a.kind === "Wide" && b.kind === "Narrow" || a.kind === "Narrow" && b.kind === "Wide";
|
|
294
|
+
}
|
|
295
|
+
static isWesternBracketCjkInterCharBoundary(t, c, r, a, b) {
|
|
296
|
+
const l = r[a].kind !== "CjkPunctuation" && UnicodePunctuationBoundaryResolver.westernCp(UnicodePunctuationBoundaryResolver.lastSig(t.substring(c[a].range.start, c[a].range.end)));
|
|
297
|
+
const q = r[b].kind !== "CjkPunctuation" && UnicodePunctuationBoundaryResolver.westernCp(UnicodePunctuationBoundaryResolver.firstSig(t.substring(c[b].range.start, c[b].range.end)));
|
|
298
|
+
return l && r[b].kind === "CjkText" || r[a].kind === "CjkText" && q;
|
|
299
|
+
}
|
|
300
|
+
static westernCp(s) {
|
|
301
|
+
return s !== null && (UnicodePunctuationLineBreak.classOf(s.codePoint).kind === "OpenPunctuation" || UnicodePunctuationLineBreak.classOf(s.codePoint).kind === "ClosePunctuation" || UnicodePunctuationLineBreak.classOf(s.codePoint).kind === "CloseParenthesis");
|
|
302
|
+
}
|
|
303
|
+
static forbidClass(c) {
|
|
304
|
+
return c.kind === "ClosePunctuation" || c.kind === "CloseParenthesis" || c.kind === "Exclamation" || c.kind === "InfixNumericSeparator";
|
|
305
|
+
}
|
|
306
|
+
static rule(c) {
|
|
307
|
+
return (c.kind === "InfixNumericSeparator" ? "LB15d" : "LB13");
|
|
308
|
+
}
|
|
309
|
+
static decimalAfterSpace(i, t, c) {
|
|
310
|
+
if (i <= 0) {
|
|
311
|
+
return false;
|
|
312
|
+
}
|
|
313
|
+
const p = t.substring(c[i - 1].range.start, c[i - 1].range.end);
|
|
314
|
+
if (p.length === 0) {
|
|
315
|
+
return false;
|
|
316
|
+
}
|
|
317
|
+
let j = 0;
|
|
318
|
+
while (j < p.length) {
|
|
319
|
+
if (!UnicodePunctuationBoundaryResolver.isWs((Number.isNaN(p.charCodeAt(j)) ? null : p.charCodeAt(j)))) {
|
|
320
|
+
return false;
|
|
321
|
+
}
|
|
322
|
+
j++;
|
|
323
|
+
}
|
|
324
|
+
const cur = t.substring(c[i].range.start, c[i].range.end);
|
|
325
|
+
const cp = (cur.length > 1 ? UnicodePunctuationBoundaryResolver.cpAt(cur, 1) : (i + 1 < c.length ? UnicodePunctuationBoundaryResolver.cpAt(t.substring(c[i + 1].range.start, c[i + 1].range.end), 0) : null));
|
|
326
|
+
return cp !== null && cp >= 48 && cp <= 57;
|
|
327
|
+
}
|
|
328
|
+
static quoteDir(t, o, cp, c) {
|
|
329
|
+
if (c.kind !== "Quotation") {
|
|
330
|
+
return Dir.None;
|
|
331
|
+
}
|
|
332
|
+
if (cp === 8217) {
|
|
333
|
+
const l = UnicodePunctuationBoundaryResolver.word(UnicodePunctuationBoundaryResolver.cpBefore(t, o));
|
|
334
|
+
const rr = UnicodePunctuationBoundaryResolver.word(UnicodePunctuationBoundaryResolver.cpAt(t, o + 1));
|
|
335
|
+
return (l && rr ? Dir.Word : (l ? Dir.Final : (rr ? Dir.Initial : Dir.Final)));
|
|
336
|
+
}
|
|
337
|
+
return (cp === 171 || cp === 8216 || cp === 8219 || cp === 8220 || cp === 8223 || cp === 8249 ? Dir.Initial : (cp === 187 || cp === 8217 || cp === 8221 || cp === 8250 ? Dir.Final : Dir.Unresolved));
|
|
338
|
+
}
|
|
339
|
+
static word(cp) {
|
|
340
|
+
return cp !== null && (cp >= 65 && cp <= 90 || cp >= 97 && cp <= 122 || cp >= 48 && cp <= 57 || cp >= 192 && cp <= 591);
|
|
341
|
+
}
|
|
342
|
+
static follows(t, o) {
|
|
343
|
+
let x = o;
|
|
344
|
+
while (x > 0) {
|
|
345
|
+
const p = UnicodePunctuationBoundaryResolver.cpBefore(t, x);
|
|
346
|
+
if (p === null || isMandatoryBreakCodePoint((p)) || isZeroWidthSpaceCodePoint((p))) {
|
|
347
|
+
return true;
|
|
348
|
+
}
|
|
349
|
+
if (!UnicodePunctuationBoundaryResolver.isWs((p))) {
|
|
350
|
+
return false;
|
|
351
|
+
}
|
|
352
|
+
x--;
|
|
353
|
+
}
|
|
354
|
+
return true;
|
|
355
|
+
}
|
|
356
|
+
static isWs(cp) {
|
|
357
|
+
return cp <= 65535 && (cp >= 9 && cp <= 13 || cp >= 28 && cp <= 32 || cp === 160 || cp === 5760 || cp >= 8192 && cp <= 8202 || cp === 8232 || cp === 8233 || cp === 8239 || cp === 8287 || cp === 12288);
|
|
358
|
+
}
|
|
359
|
+
static previous(i, t, c) {
|
|
360
|
+
let x = i - 1;
|
|
361
|
+
while (x >= 0) {
|
|
362
|
+
const s = t.substring(c[x].range.start, c[x].range.end);
|
|
363
|
+
if (UnicodePunctuationBoundaryResolver.hasBreak(s)) {
|
|
364
|
+
return null;
|
|
365
|
+
}
|
|
366
|
+
if (UnicodePunctuationBoundaryResolver.firstSig(s) !== null) {
|
|
367
|
+
return x;
|
|
368
|
+
}
|
|
369
|
+
x--;
|
|
370
|
+
}
|
|
371
|
+
return null;
|
|
372
|
+
}
|
|
373
|
+
static next(i, t, c) {
|
|
374
|
+
let x = i + 1;
|
|
375
|
+
while (x < c.length) {
|
|
376
|
+
const s = t.substring(c[x].range.start, c[x].range.end);
|
|
377
|
+
if (UnicodePunctuationBoundaryResolver.hasBreak(s)) {
|
|
378
|
+
return null;
|
|
379
|
+
}
|
|
380
|
+
if (UnicodePunctuationBoundaryResolver.firstSig(s) !== null) {
|
|
381
|
+
return x;
|
|
382
|
+
}
|
|
383
|
+
x++;
|
|
384
|
+
}
|
|
385
|
+
return null;
|
|
386
|
+
}
|
|
387
|
+
static hasBreak(s) {
|
|
388
|
+
let i = 0;
|
|
389
|
+
while (i < s.length) {
|
|
390
|
+
const p = UnicodePunctuationBoundaryResolver.cpAt(s, i);
|
|
391
|
+
if (p === null) {
|
|
392
|
+
return false;
|
|
393
|
+
}
|
|
394
|
+
if (isMandatoryBreakCodePoint((p)) || isZeroWidthSpaceCodePoint((p))) {
|
|
395
|
+
return true;
|
|
396
|
+
}
|
|
397
|
+
i += (p > 65535 ? 2 : 1);
|
|
398
|
+
}
|
|
399
|
+
return false;
|
|
400
|
+
}
|
|
401
|
+
static cpAt(s, i) {
|
|
402
|
+
if (i < 0 || i >= s.length) {
|
|
403
|
+
return null;
|
|
404
|
+
}
|
|
405
|
+
const h = (Number.isNaN(s.charCodeAt(i)) ? null : s.charCodeAt(i));
|
|
406
|
+
if (h < 55296 || h > 56319 || i + 1 >= s.length) {
|
|
407
|
+
return h;
|
|
408
|
+
}
|
|
409
|
+
const l = readUnit(s, i + 1);
|
|
410
|
+
return (l >= 56320 && l <= 57343 ? 65536 + (h - 55296 << 10) + (l - 56320) : h);
|
|
411
|
+
}
|
|
412
|
+
static cpBefore(s, i) {
|
|
413
|
+
if (i <= 0 || i > s.length) {
|
|
414
|
+
return null;
|
|
415
|
+
}
|
|
416
|
+
const l = readUnit(s, i - 1);
|
|
417
|
+
if (l >= 56320 && l <= 57343 && i > 1) {
|
|
418
|
+
const h = readUnit(s, i - 2);
|
|
419
|
+
if (h >= 55296 && h <= 56319) {
|
|
420
|
+
return 65536 + (h - 55296 << 10) + (l - 56320);
|
|
421
|
+
}
|
|
422
|
+
}
|
|
423
|
+
return l;
|
|
424
|
+
}
|
|
425
|
+
static firstSig(s) {
|
|
426
|
+
let i = 0;
|
|
427
|
+
while (i < s.length) {
|
|
428
|
+
const p = UnicodePunctuationBoundaryResolver.cpAt(s, i);
|
|
429
|
+
if (p === null) {
|
|
430
|
+
return null;
|
|
431
|
+
}
|
|
432
|
+
if (!UnicodePunctuationBoundaryResolver.isWs((p))) {
|
|
433
|
+
return new SignificantCodePoint(i, (p));
|
|
434
|
+
}
|
|
435
|
+
i++;
|
|
436
|
+
}
|
|
437
|
+
return null;
|
|
438
|
+
}
|
|
439
|
+
static lastSig(s) {
|
|
440
|
+
let e = s.length;
|
|
441
|
+
while (e > 0) {
|
|
442
|
+
const i = (readUnit(s, e - 1) >= 56320 && readUnit(s, e - 1) <= 57343 ? e - 2 : e - 1);
|
|
443
|
+
const p = UnicodePunctuationBoundaryResolver.cpAt(s, i);
|
|
444
|
+
if (p === null) {
|
|
445
|
+
return null;
|
|
446
|
+
}
|
|
447
|
+
if (!UnicodePunctuationBoundaryResolver.isWs((p))) {
|
|
448
|
+
return new SignificantCodePoint(i, (p));
|
|
449
|
+
}
|
|
450
|
+
e = i;
|
|
451
|
+
}
|
|
452
|
+
return null;
|
|
453
|
+
}
|
|
454
|
+
static distinct(a) {
|
|
455
|
+
const r = [];
|
|
456
|
+
let i = 0;
|
|
457
|
+
while (i < a.length) {
|
|
458
|
+
let found = false;
|
|
459
|
+
let j = 0;
|
|
460
|
+
while (j < r.length) {
|
|
461
|
+
if (r[j].start === a[i].start && r[j].end === a[i].end) {
|
|
462
|
+
found = true;
|
|
463
|
+
}
|
|
464
|
+
j++;
|
|
465
|
+
}
|
|
466
|
+
if (!found) {
|
|
467
|
+
r.push(a[i]);
|
|
468
|
+
}
|
|
469
|
+
i++;
|
|
470
|
+
}
|
|
471
|
+
return r;
|
|
472
|
+
}
|
|
473
|
+
}
|
|
474
|
+
export const Dir = Object.freeze({
|
|
475
|
+
Initial: Object.freeze({ kind: "Initial" }),
|
|
476
|
+
Final: Object.freeze({ kind: "Final" }),
|
|
477
|
+
Unresolved: Object.freeze({ kind: "Unresolved" }),
|
|
478
|
+
Word: Object.freeze({ kind: "Word" }),
|
|
479
|
+
None: Object.freeze({ kind: "None" })
|
|
480
|
+
});
|
|
481
|
+
export function compareDir(a, b) {
|
|
482
|
+
if (a === b)
|
|
483
|
+
return 0;
|
|
484
|
+
if (a.kind === "Initial")
|
|
485
|
+
return 0 - (b.kind === "Initial" ? 0 : 0);
|
|
486
|
+
if (a.kind === "Final")
|
|
487
|
+
return 1 - (b.kind === "Final" ? 1 : 0);
|
|
488
|
+
if (a.kind === "Unresolved")
|
|
489
|
+
return 2 - (b.kind === "Unresolved" ? 2 : 0);
|
|
490
|
+
if (a.kind === "Word")
|
|
491
|
+
return 3 - (b.kind === "Word" ? 3 : 0);
|
|
492
|
+
if (a.kind === "None")
|
|
493
|
+
return 4 - (b.kind === "None" ? 4 : 0);
|
|
494
|
+
return 0;
|
|
495
|
+
}
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
import { type ClreqProfile } from "./../clreq/ClreqProfile.js";
|
|
2
|
+
import { ClreqPunctuationGlyphSubstitutor } from "./../clreq/ClreqPunctuationGlyphSubstitutor.js";
|
|
3
|
+
import { type Cluster } from "./../core/Cluster.js";
|
|
4
|
+
import { type DecorationSpan } from "./../core/DecorationSpan.js";
|
|
5
|
+
import { type InlineBoxSpan } from "./../core/InlineBoxSpan.js";
|
|
6
|
+
import { type InlineObjectSpan } from "./../core/InlineObjectSpan.js";
|
|
7
|
+
import { type LayoutInput } from "./../core/LayoutInput.js";
|
|
8
|
+
import { type LayoutProfileId } from "./../core/LayoutProfileId.js";
|
|
9
|
+
import { type LineBreakSpan } from "./../core/LineBreakSpan.js";
|
|
10
|
+
import { RoleOverrideInfo } from "./../core/RoleOverrideInfo.js";
|
|
11
|
+
import { type RubySpan } from "./../core/RubySpan.js";
|
|
12
|
+
import { TextRange } from "./../core/TextRange.js";
|
|
13
|
+
import { type TextSpan } from "./../core/TextSpan.js";
|
|
14
|
+
import { TextStyle } from "./../core/TextStyle.js";
|
|
15
|
+
import { type FontDecision } from "./../font/FontPolicy.js";
|
|
16
|
+
import { RubyFontGeometry } from "./AnnotationGeometryStage.js";
|
|
17
|
+
import { type ResolvedClusterRange } from "./ClusterRoleResolution.js";
|
|
18
|
+
import { ParagraphLayoutPrep } from "./LineBreakPlanningStage.js";
|
|
19
|
+
import { type ExplainableStubParagraphLayoutEngine } from "./ParagraphLayoutEngine.js";
|
|
20
|
+
import { type ParagraphShapingStageResult } from "./ParagraphShapingStage.js";
|
|
21
|
+
import { type PunctuationAtom } from "./PunctuationModel.js";
|
|
22
|
+
import { type QuotePair } from "./QuotePairAnalyzer.js";
|
|
23
|
+
import { type ShapingResult } from "./../shaping/TextShaper.js";
|
|
24
|
+
import { SortedMapTable, SortedSetTable } from "../../../runtime.js";
|
|
25
|
+
export declare class WidthIndependentAnnotationKey {
|
|
26
|
+
readonly text: string;
|
|
27
|
+
readonly spans: readonly TextSpan[];
|
|
28
|
+
readonly lineBreakSpans: readonly LineBreakSpan[];
|
|
29
|
+
readonly sourceBoundaries: readonly number[];
|
|
30
|
+
readonly textStyle: TextStyle;
|
|
31
|
+
readonly decorations: readonly DecorationSpan[];
|
|
32
|
+
readonly rubySpans: readonly RubySpan[];
|
|
33
|
+
readonly inlineBoxes: readonly InlineBoxSpan[];
|
|
34
|
+
readonly inlineObjects: readonly InlineObjectSpan[];
|
|
35
|
+
readonly profileId: LayoutProfileId;
|
|
36
|
+
readonly emphasisDotGapEm: number;
|
|
37
|
+
readonly rejectedTechnicalTiersBySpan: SortedMapTable<TextRange, SortedSetTable<number>>;
|
|
38
|
+
constructor(text: string, spans: readonly TextSpan[], lineBreakSpans: readonly LineBreakSpan[], sourceBoundaries: readonly number[], textStyle: TextStyle, decorations: readonly DecorationSpan[], rubySpans: readonly RubySpan[], inlineBoxes: readonly InlineBoxSpan[], inlineObjects: readonly InlineObjectSpan[], profileId: LayoutProfileId, emphasisDotGapEm: number, rejectedTechnicalTiersBySpan: SortedMapTable<TextRange, SortedSetTable<number>>);
|
|
39
|
+
toString(): string;
|
|
40
|
+
}
|
|
41
|
+
export declare class WidthIndependentParagraphAnnotation {
|
|
42
|
+
readonly text: string;
|
|
43
|
+
readonly fontSize: number;
|
|
44
|
+
readonly styleAt: (a0: number) => TextStyle;
|
|
45
|
+
readonly fontSizeAt: (a0: number) => number;
|
|
46
|
+
readonly bopomofoFontWeightAt: (a0: number) => number;
|
|
47
|
+
readonly rubyFontSize: number;
|
|
48
|
+
readonly rubyStackGap: number;
|
|
49
|
+
readonly rubyFontWeight: number;
|
|
50
|
+
readonly pinyinSpans: RubySpan[];
|
|
51
|
+
readonly clreqProfile: ClreqProfile;
|
|
52
|
+
readonly punctuationGlyphSubstitutor: ClreqPunctuationGlyphSubstitutor;
|
|
53
|
+
readonly quotePairs: QuotePair[];
|
|
54
|
+
readonly roleOverrideInfos: RoleOverrideInfo[];
|
|
55
|
+
readonly fontDecisions: FontDecision[];
|
|
56
|
+
readonly clusterRanges: ResolvedClusterRange[];
|
|
57
|
+
readonly fontDecisionByRange: SortedMapTable<TextRange, FontDecision>;
|
|
58
|
+
readonly inlineObjectByRange: SortedMapTable<TextRange, InlineObjectSpan>;
|
|
59
|
+
readonly segmentShapingCache: SortedMapTable<TextRange, ShapingResult>;
|
|
60
|
+
readonly substitutionRollbacks: SortedMapTable<TextRange, string>;
|
|
61
|
+
readonly rubyFontGeometryBySpan: SortedMapTable<RubySpan, RubyFontGeometry>;
|
|
62
|
+
readonly baseShapingStage: ParagraphShapingStageResult;
|
|
63
|
+
constructor(text: string, fontSize: number, styleAt: (a0: number) => TextStyle, fontSizeAt: (a0: number) => number, bopomofoFontWeightAt: (a0: number) => number, rubyFontSize: number, rubyStackGap: number, rubyFontWeight: number, pinyinSpans: RubySpan[], clreqProfile: ClreqProfile, punctuationGlyphSubstitutor: ClreqPunctuationGlyphSubstitutor, quotePairs: QuotePair[], roleOverrideInfos: RoleOverrideInfo[], fontDecisions: FontDecision[], clusterRanges: ResolvedClusterRange[], fontDecisionByRange: SortedMapTable<TextRange, FontDecision>, inlineObjectByRange: SortedMapTable<TextRange, InlineObjectSpan>, segmentShapingCache: SortedMapTable<TextRange, ShapingResult>, substitutionRollbacks: SortedMapTable<TextRange, string>, rubyFontGeometryBySpan: SortedMapTable<RubySpan, RubyFontGeometry>, baseShapingStage: ParagraphShapingStageResult);
|
|
64
|
+
}
|
|
65
|
+
export type WidthIndependentAnnotationCacheGetFn = (key: WidthIndependentAnnotationKey) => WidthIndependentParagraphAnnotation | null;
|
|
66
|
+
export type WidthIndependentAnnotationCachePutFn = (key: WidthIndependentAnnotationKey, annotation: WidthIndependentParagraphAnnotation) => void;
|
|
67
|
+
export type WidthIndependentAnnotationCacheClearFn = () => void;
|
|
68
|
+
export interface WidthIndependentAnnotationCache {
|
|
69
|
+
readonly size: number;
|
|
70
|
+
readonly get: WidthIndependentAnnotationCacheGetFn;
|
|
71
|
+
readonly put: WidthIndependentAnnotationCachePutFn;
|
|
72
|
+
readonly clear: WidthIndependentAnnotationCacheClearFn;
|
|
73
|
+
}
|
|
74
|
+
export declare class LruWidthIndependentAnnotationCache implements WidthIndependentAnnotationCache {
|
|
75
|
+
readonly maxEntries: number;
|
|
76
|
+
private readonly map;
|
|
77
|
+
private readonly keys;
|
|
78
|
+
constructor(maxEntries: number);
|
|
79
|
+
get(key: WidthIndependentAnnotationKey): WidthIndependentParagraphAnnotation | null;
|
|
80
|
+
put(key: WidthIndependentAnnotationKey, annotation: WidthIndependentParagraphAnnotation): void;
|
|
81
|
+
clear(): void;
|
|
82
|
+
get size(): number;
|
|
83
|
+
get_size(): number;
|
|
84
|
+
private static removeKeyFromList;
|
|
85
|
+
}
|
|
86
|
+
export declare class WidthIndependentAnnotationCacheFns {
|
|
87
|
+
private static renderNullableLastLineAlignment;
|
|
88
|
+
private static renderLastLineAlignment;
|
|
89
|
+
private static copyFontFamilies;
|
|
90
|
+
private static isFixedBoundary;
|
|
91
|
+
static isContainedIn(r: TextRange, other: TextRange): boolean;
|
|
92
|
+
static containingFontDecisions(clusters: Cluster[], items: FontDecision[]): (FontDecision | null)[];
|
|
93
|
+
static firstContainedAtom(clusters: Cluster[], items: PunctuationAtom[]): (PunctuationAtom | null)[];
|
|
94
|
+
private static quoteToRoleOverrideInfos;
|
|
95
|
+
static toWidthIndependentAnnotationKey(input: LayoutInput, rejectedTechnicalTiersBySpan?: SortedMapTable<TextRange, SortedSetTable<number>> | null): WidthIndependentAnnotationKey;
|
|
96
|
+
private static clampInt;
|
|
97
|
+
private static isInlineStop;
|
|
98
|
+
static prepareWidthIndependentAnnotation(engine: ExplainableStubParagraphLayoutEngine, input: LayoutInput, rejectedTechnicalTiersBySpan: SortedMapTable<TextRange, SortedSetTable<number>>): WidthIndependentParagraphAnnotation;
|
|
99
|
+
private static computeRubySpread;
|
|
100
|
+
private static addGeometryAwareOpportunity;
|
|
101
|
+
static buildParagraphLayoutPrep(engine: ExplainableStubParagraphLayoutEngine, input: LayoutInput, annotation: WidthIndependentParagraphAnnotation, rejectedTechnicalTiersBySpan: SortedMapTable<TextRange, SortedSetTable<number>>): ParagraphLayoutPrep;
|
|
102
|
+
}
|