@tiqian/engine 0.0.1 → 0.1.0-alpha.10
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,251 @@
|
|
|
1
|
+
// Generated by the reflaxe TypeScript target. Do not edit.
|
|
2
|
+
import { UnicodeNumber } from "./../core/UnicodeNumber.js";
|
|
3
|
+
import { UnicodeScriptEvidenceClassifier } from "./../core/UnicodeScriptEvidenceClassifier.js";
|
|
4
|
+
import { UnicodeWordCharacter } from "./../core/UnicodeWordCharacter.js";
|
|
5
|
+
import { FontRoleContext } from "./../font/FontRoleContext.js";
|
|
6
|
+
import { ContextualQuoteRoleResolver } from "./ContextualQuoteRoleResolver.js";
|
|
7
|
+
import { SortedTable, readUnit } from "../../../runtime.js";
|
|
8
|
+
export class QuotePair {
|
|
9
|
+
openIndex;
|
|
10
|
+
closeIndex;
|
|
11
|
+
quoteType;
|
|
12
|
+
constructor(openIndex, closeIndex, quoteType) {
|
|
13
|
+
this.openIndex = openIndex;
|
|
14
|
+
this.closeIndex = closeIndex;
|
|
15
|
+
this.quoteType = quoteType;
|
|
16
|
+
}
|
|
17
|
+
toString() {
|
|
18
|
+
return `QuotePair(openIndex=${this.openIndex}, closeIndex=${this.closeIndex}, quoteType=${this.quoteType.kind})`;
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
export function QuotePairquoteTypeOrder(v) {
|
|
22
|
+
if (v.kind === "Double")
|
|
23
|
+
return 0;
|
|
24
|
+
if (v.kind === "Single")
|
|
25
|
+
return 1;
|
|
26
|
+
return 0;
|
|
27
|
+
}
|
|
28
|
+
export function compareQuotePair(a, b) {
|
|
29
|
+
if (a === b)
|
|
30
|
+
return 0;
|
|
31
|
+
if (a.openIndex !== b.openIndex)
|
|
32
|
+
return a.openIndex - b.openIndex;
|
|
33
|
+
if (a.closeIndex !== b.closeIndex)
|
|
34
|
+
return a.closeIndex - b.closeIndex;
|
|
35
|
+
if (QuotePairquoteTypeOrder(a.quoteType) !== QuotePairquoteTypeOrder(b.quoteType))
|
|
36
|
+
return QuotePairquoteTypeOrder(a.quoteType) - QuotePairquoteTypeOrder(b.quoteType);
|
|
37
|
+
return 0;
|
|
38
|
+
}
|
|
39
|
+
export class QuoteRoleDecision {
|
|
40
|
+
index;
|
|
41
|
+
role;
|
|
42
|
+
source;
|
|
43
|
+
reason;
|
|
44
|
+
constructor(index, role, source, reason) {
|
|
45
|
+
this.index = index;
|
|
46
|
+
this.role = role;
|
|
47
|
+
this.source = source;
|
|
48
|
+
this.reason = reason;
|
|
49
|
+
}
|
|
50
|
+
toString() {
|
|
51
|
+
return `QuoteRoleDecision(index=${this.index}, role=${this.role.kind}, source=${this.source}, reason=${this.reason})`;
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
export function QuoteRoleDecisionroleOrder(v) {
|
|
55
|
+
if (v.kind === "CjkText")
|
|
56
|
+
return 0;
|
|
57
|
+
if (v.kind === "CjkPunctuation")
|
|
58
|
+
return 1;
|
|
59
|
+
if (v.kind === "LatinText")
|
|
60
|
+
return 2;
|
|
61
|
+
if (v.kind === "Symbol")
|
|
62
|
+
return 3;
|
|
63
|
+
if (v.kind === "Emoji")
|
|
64
|
+
return 4;
|
|
65
|
+
if (v.kind === "Unknown")
|
|
66
|
+
return 5;
|
|
67
|
+
return 0;
|
|
68
|
+
}
|
|
69
|
+
export function compareQuoteRoleDecision(a, b) {
|
|
70
|
+
if (a === b)
|
|
71
|
+
return 0;
|
|
72
|
+
if (a.index !== b.index)
|
|
73
|
+
return a.index - b.index;
|
|
74
|
+
if (QuoteRoleDecisionroleOrder(a.role) !== QuoteRoleDecisionroleOrder(b.role))
|
|
75
|
+
return QuoteRoleDecisionroleOrder(a.role) - QuoteRoleDecisionroleOrder(b.role);
|
|
76
|
+
if (a.source !== b.source)
|
|
77
|
+
return a.source < b.source ? -1 : 1;
|
|
78
|
+
if (a.reason !== b.reason)
|
|
79
|
+
return a.reason < b.reason ? -1 : 1;
|
|
80
|
+
return 0;
|
|
81
|
+
}
|
|
82
|
+
export class QuotePairAnalyzer {
|
|
83
|
+
constructor() {
|
|
84
|
+
}
|
|
85
|
+
analyze(text) {
|
|
86
|
+
const stack = [];
|
|
87
|
+
const pairs = [];
|
|
88
|
+
let index = 0;
|
|
89
|
+
while (index < text.length) {
|
|
90
|
+
const c = (Number.isNaN(text.charCodeAt(index)) ? null : text.charCodeAt(index));
|
|
91
|
+
if (c === 8220) {
|
|
92
|
+
stack.push({ index, type: QuoteType.Double });
|
|
93
|
+
}
|
|
94
|
+
else {
|
|
95
|
+
if (c === 8216) {
|
|
96
|
+
stack.push({ index, type: QuoteType.Single });
|
|
97
|
+
}
|
|
98
|
+
else {
|
|
99
|
+
if (c === 8221) {
|
|
100
|
+
if (stack.length > 0 && stack[stack.length - 1].type.kind === "Double") {
|
|
101
|
+
const match = stack.pop();
|
|
102
|
+
pairs.push(new QuotePair(match.index, index, QuoteType.Double));
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
else {
|
|
106
|
+
if (c === 8217) {
|
|
107
|
+
if (!QuotePairAnalyzer.isNonCjkInWordApostrophe(text, index) && stack.length > 0 && stack[stack.length - 1].type.kind === "Single") {
|
|
108
|
+
const match2 = stack.pop();
|
|
109
|
+
pairs.push(new QuotePair(match2.index, index, QuoteType.Single));
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
index++;
|
|
116
|
+
}
|
|
117
|
+
return pairs;
|
|
118
|
+
}
|
|
119
|
+
classifyPairs(text, pairs, context) {
|
|
120
|
+
context = context ?? null;
|
|
121
|
+
return QuotePairAnalyzer.mapDecisions(this.classifyQuoteRoles(text, pairs, context));
|
|
122
|
+
}
|
|
123
|
+
classifyPairsWithClassifier(text, pairs, _fontRoleClassifier, context) {
|
|
124
|
+
context = context ?? null;
|
|
125
|
+
return this.classifyPairs(text, pairs, context);
|
|
126
|
+
}
|
|
127
|
+
classifyQuoteRoles(text, pairs, context) {
|
|
128
|
+
context = context ?? null;
|
|
129
|
+
return new ContextualQuoteRoleResolver(text, pairs, ((context === null ? new FontRoleContext("zh-Hans", null) : context))).resolve();
|
|
130
|
+
}
|
|
131
|
+
classifyQuoteRolesWithClassifier(text, pairs, _fontRoleClassifier, context) {
|
|
132
|
+
context = context ?? null;
|
|
133
|
+
return this.classifyQuoteRoles(text, pairs, context);
|
|
134
|
+
}
|
|
135
|
+
static mapDecisions(decisions) {
|
|
136
|
+
const out = SortedTable.mapBuilder(SortedTable.compareInts);
|
|
137
|
+
for (let pipeline_index = 0, count = decisions.length; pipeline_index < count; pipeline_index += 1) {
|
|
138
|
+
const d = decisions[pipeline_index];
|
|
139
|
+
out.put(d.index, d.role);
|
|
140
|
+
}
|
|
141
|
+
return out.build();
|
|
142
|
+
}
|
|
143
|
+
static isNonCjkInWordApostrophe(text, index) {
|
|
144
|
+
const before = QuotePairAnalyzer.codePointBefore(text, index);
|
|
145
|
+
if (before === null) {
|
|
146
|
+
return false;
|
|
147
|
+
}
|
|
148
|
+
const after = QuotePairAnalyzer.codePointAtOrNull(text, index + 1);
|
|
149
|
+
if (after === null) {
|
|
150
|
+
return false;
|
|
151
|
+
}
|
|
152
|
+
return QuotePairAnalyzer.isNonCjkWordCharacter((before)) && QuotePairAnalyzer.isNonCjkWordCharacter((after)) && (QuotePairAnalyzer.isNonCjkNonNumericWordCharacter((before)) || QuotePairAnalyzer.isNonCjkNonNumericWordCharacter((after)));
|
|
153
|
+
}
|
|
154
|
+
static isDigitBoundClosingQuote(text, index) {
|
|
155
|
+
return ((Number.isNaN(text.charCodeAt(index)) ? null : text.charCodeAt(index)) === 8217 || (Number.isNaN(text.charCodeAt(index)) ? null : text.charCodeAt(index)) === 8221) && QuotePairAnalyzer.codePointBefore(text, index) !== null && UnicodeNumber.contains((QuotePairAnalyzer.codePointBefore(text, index)));
|
|
156
|
+
}
|
|
157
|
+
static isNonCjkWordInternalQuotePair(text, pair) {
|
|
158
|
+
const before = QuotePairAnalyzer.codePointBefore(text, pair.openIndex);
|
|
159
|
+
const after = QuotePairAnalyzer.codePointAtOrNull(text, pair.closeIndex + 1);
|
|
160
|
+
if (before === null || after === null || !QuotePairAnalyzer.isNonCjkNonNumericWordCharacter((before)) || !QuotePairAnalyzer.isNonCjkNonNumericWordCharacter((after))) {
|
|
161
|
+
return false;
|
|
162
|
+
}
|
|
163
|
+
let index = pair.openIndex + 1;
|
|
164
|
+
while (index < pair.closeIndex) {
|
|
165
|
+
const cp = QuotePairAnalyzer.codePointAtOrNull(text, index);
|
|
166
|
+
if (cp === null || !QuotePairAnalyzer.isNonCjkWordCharacter((cp))) {
|
|
167
|
+
return false;
|
|
168
|
+
}
|
|
169
|
+
index += (cp > 65535 ? 2 : 1);
|
|
170
|
+
}
|
|
171
|
+
return true;
|
|
172
|
+
}
|
|
173
|
+
static isNonCjkWordCharacter(cp) {
|
|
174
|
+
return UnicodeWordCharacter.contains(cp) && UnicodeScriptEvidenceClassifier.classify(cp).kind !== "EastAsian";
|
|
175
|
+
}
|
|
176
|
+
static isNonCjkNonNumericWordCharacter(cp) {
|
|
177
|
+
return QuotePairAnalyzer.isNonCjkWordCharacter(cp) && !UnicodeNumber.contains(cp) && !QuotePairAnalyzer.isFullwidthEastAsianWidth(cp);
|
|
178
|
+
}
|
|
179
|
+
static isFullwidthEastAsianWidth(cp) {
|
|
180
|
+
return cp === 12288 || cp >= 65281 && cp <= 65376 || cp >= 65504 && cp <= 65510;
|
|
181
|
+
}
|
|
182
|
+
static codePointBefore(text, index) {
|
|
183
|
+
if (index <= 0) {
|
|
184
|
+
return null;
|
|
185
|
+
}
|
|
186
|
+
const low = readUnit(text, index - 1);
|
|
187
|
+
if (low < 56320 || low > 57343 || index < 2) {
|
|
188
|
+
return low;
|
|
189
|
+
}
|
|
190
|
+
const high = readUnit(text, index - 2);
|
|
191
|
+
if (high < 55296 || high > 56319) {
|
|
192
|
+
return low;
|
|
193
|
+
}
|
|
194
|
+
return 65536 + (high - 55296 << 10) + (low - 56320);
|
|
195
|
+
}
|
|
196
|
+
static codePointAtOrNull(text, index) {
|
|
197
|
+
if (index < 0 || index >= text.length) {
|
|
198
|
+
return null;
|
|
199
|
+
}
|
|
200
|
+
const high = (Number.isNaN(text.charCodeAt(index)) ? null : text.charCodeAt(index));
|
|
201
|
+
if (high < 55296 || high > 56319 || index + 1 >= text.length) {
|
|
202
|
+
return high;
|
|
203
|
+
}
|
|
204
|
+
const low = readUnit(text, index + 1);
|
|
205
|
+
if (low < 56320 || low > 57343) {
|
|
206
|
+
return high;
|
|
207
|
+
}
|
|
208
|
+
return 65536 + (high - 55296 << 10) + (low - 56320);
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
export class QuotePairAwareFontRoleClassifier {
|
|
212
|
+
delegate;
|
|
213
|
+
quoteRoles;
|
|
214
|
+
constructor(delegate, quoteRoles) {
|
|
215
|
+
this.delegate = delegate;
|
|
216
|
+
this.quoteRoles = quoteRoles;
|
|
217
|
+
}
|
|
218
|
+
classify(text, range, context) {
|
|
219
|
+
context = context ?? null;
|
|
220
|
+
const role = this.quoteRoles.get(range.start);
|
|
221
|
+
return (role === null ? this.delegate.classify(text, range, context) : role);
|
|
222
|
+
}
|
|
223
|
+
static withContextualQuoteRoles(base, text, context) {
|
|
224
|
+
context = context ?? null;
|
|
225
|
+
const analyzer = new QuotePairAnalyzer();
|
|
226
|
+
const decisions = analyzer.classifyQuoteRoles(text, analyzer.analyze(text), context);
|
|
227
|
+
const count2 = decisions.length;
|
|
228
|
+
if (count2 === 0) {
|
|
229
|
+
return base;
|
|
230
|
+
}
|
|
231
|
+
const roles = SortedTable.mapBuilder(SortedTable.compareInts);
|
|
232
|
+
for (let pipeline_index = 0; pipeline_index < count2; pipeline_index += 1) {
|
|
233
|
+
const decision = decisions[pipeline_index];
|
|
234
|
+
roles.put(decision.index, decision.role);
|
|
235
|
+
}
|
|
236
|
+
return new QuotePairAwareFontRoleClassifier(base, roles.build());
|
|
237
|
+
}
|
|
238
|
+
}
|
|
239
|
+
export const QuoteType = Object.freeze({
|
|
240
|
+
Double: Object.freeze({ kind: "Double" }),
|
|
241
|
+
Single: Object.freeze({ kind: "Single" })
|
|
242
|
+
});
|
|
243
|
+
export function compareQuoteType(a, b) {
|
|
244
|
+
if (a === b)
|
|
245
|
+
return 0;
|
|
246
|
+
if (a.kind === "Double")
|
|
247
|
+
return 0 - (b.kind === "Double" ? 0 : 0);
|
|
248
|
+
if (a.kind === "Single")
|
|
249
|
+
return 1 - (b.kind === "Single" ? 1 : 0);
|
|
250
|
+
return 0;
|
|
251
|
+
}
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
import { type Cluster } from "./../core/Cluster.js";
|
|
2
|
+
import { ContextualKinsokuDecisionInfo } from "./../core/ContextualKinsokuDecisionInfo.js";
|
|
3
|
+
import { type EastAsianSpacingEdges } from "./../core/EastAsianSpacingEdges.js";
|
|
4
|
+
import { type InlineAttachment } from "./../core/InlineAttachment.js";
|
|
5
|
+
import { IntRange } from "./../core/IntRange.js";
|
|
6
|
+
import { type FontRole } from "./../font/FontRole.js";
|
|
7
|
+
import { type QuotePair } from "./QuotePairAnalyzer.js";
|
|
8
|
+
import { SortedMapTable, SortedSetTable } from "../../../runtime.js";
|
|
9
|
+
export declare class SignificantCodePoint {
|
|
10
|
+
readonly offset: number;
|
|
11
|
+
readonly codePoint: number;
|
|
12
|
+
constructor(offset: number, codePoint: number);
|
|
13
|
+
toString(): string;
|
|
14
|
+
}
|
|
15
|
+
export declare function compareSignificantCodePoint(a: SignificantCodePoint, b: SignificantCodePoint): number;
|
|
16
|
+
export declare class UnicodePunctuationBoundaries {
|
|
17
|
+
readonly forbiddenLineStartClusters: SortedSetTable<number>;
|
|
18
|
+
readonly forbiddenLineEndClusters: SortedSetTable<number>;
|
|
19
|
+
readonly unbreakableRanges: IntRange[];
|
|
20
|
+
readonly decisions: ContextualKinsokuDecisionInfo[];
|
|
21
|
+
constructor(forbiddenLineStartClusters: SortedSetTable<number>, forbiddenLineEndClusters: SortedSetTable<number>, unbreakableRanges: IntRange[], decisions: ContextualKinsokuDecisionInfo[]);
|
|
22
|
+
toString(): string;
|
|
23
|
+
}
|
|
24
|
+
export declare class AttachedInlineVirtualBoundary {
|
|
25
|
+
readonly previousClusterIndex: number;
|
|
26
|
+
readonly attachedClusterRange: IntRange;
|
|
27
|
+
readonly nextClusterIndex: number | null;
|
|
28
|
+
constructor(previousClusterIndex: number, attachedClusterRange: IntRange, nextClusterIndex: number | null);
|
|
29
|
+
toString(): string;
|
|
30
|
+
}
|
|
31
|
+
export declare class AttachedInlineInterCharBoundaries {
|
|
32
|
+
readonly ordinaryWesternBoundaryAfterClusters: SortedSetTable<number>;
|
|
33
|
+
readonly suppressedPhysicalBoundaryAfterClusters: SortedSetTable<number>;
|
|
34
|
+
readonly virtualBoundaryAfterClusters: SortedMapTable<number, number>;
|
|
35
|
+
readonly virtualSinoWesternBoundaryAfterClusters: SortedSetTable<number>;
|
|
36
|
+
constructor(ordinaryWesternBoundaryAfterClusters: SortedSetTable<number>, suppressedPhysicalBoundaryAfterClusters: SortedSetTable<number>, virtualBoundaryAfterClusters: SortedMapTable<number, number>, virtualSinoWesternBoundaryAfterClusters: SortedSetTable<number>);
|
|
37
|
+
toString(): string;
|
|
38
|
+
}
|
|
39
|
+
export declare function compareAttachedInlineInterCharBoundaries(a: AttachedInlineInterCharBoundaries, b: AttachedInlineInterCharBoundaries): number;
|
|
40
|
+
export declare class UnicodePunctuationBoundaryResolver {
|
|
41
|
+
static resolveWesternBracketCjkInterCharBoundaries(text: string, clusters: Cluster[], roles: FontRole[]): SortedSetTable<number>;
|
|
42
|
+
static resolveAttachedInlineVirtualBoundaries(a: InlineAttachment[]): AttachedInlineVirtualBoundary[];
|
|
43
|
+
static resolveAttachedInlineInterCharBoundaries(text: string, clusters: Cluster[], roles: FontRole[], edges: EastAsianSpacingEdges[], western: SortedSetTable<number>, attachments: InlineAttachment[]): AttachedInlineInterCharBoundaries;
|
|
44
|
+
static resolveUnicodePunctuationBoundaries(text: string, clusters: Cluster[], roles: FontRole[], pairs: QuotePair[]): UnicodePunctuationBoundaries;
|
|
45
|
+
private static isCjk;
|
|
46
|
+
private static wideNarrow;
|
|
47
|
+
private static isWesternBracketCjkInterCharBoundary;
|
|
48
|
+
private static westernCp;
|
|
49
|
+
private static forbidClass;
|
|
50
|
+
private static rule;
|
|
51
|
+
private static decimalAfterSpace;
|
|
52
|
+
private static quoteDir;
|
|
53
|
+
private static word;
|
|
54
|
+
private static follows;
|
|
55
|
+
private static isWs;
|
|
56
|
+
private static previous;
|
|
57
|
+
private static next;
|
|
58
|
+
private static hasBreak;
|
|
59
|
+
private static cpAt;
|
|
60
|
+
private static cpBefore;
|
|
61
|
+
private static firstSig;
|
|
62
|
+
private static lastSig;
|
|
63
|
+
private static distinct;
|
|
64
|
+
}
|
|
65
|
+
export interface Initial {
|
|
66
|
+
readonly kind: "Initial";
|
|
67
|
+
}
|
|
68
|
+
export interface Final {
|
|
69
|
+
readonly kind: "Final";
|
|
70
|
+
}
|
|
71
|
+
export interface Unresolved {
|
|
72
|
+
readonly kind: "Unresolved";
|
|
73
|
+
}
|
|
74
|
+
export interface Word {
|
|
75
|
+
readonly kind: "Word";
|
|
76
|
+
}
|
|
77
|
+
export interface None {
|
|
78
|
+
readonly kind: "None";
|
|
79
|
+
}
|
|
80
|
+
export type Dir = Initial | Final | Unresolved | Word | None;
|
|
81
|
+
export declare const Dir: Readonly<{
|
|
82
|
+
Initial: Readonly<Initial>;
|
|
83
|
+
Final: Readonly<Final>;
|
|
84
|
+
Unresolved: Readonly<Unresolved>;
|
|
85
|
+
Word: Readonly<Word>;
|
|
86
|
+
None: Readonly<None>;
|
|
87
|
+
}>;
|
|
88
|
+
export declare function compareDir(a: Dir, b: Dir): number;
|