File tree Expand file tree Collapse file tree 2 files changed +13
-2
lines changed
src/SIL.Machine/PunctuationAnalysis
tests/SIL.Machine.Tests/PunctuationAnalysis Expand file tree Collapse file tree 2 files changed +13
-2
lines changed Original file line number Diff line number Diff line change @@ -75,7 +75,7 @@ public string PreviousCharacter
7575 if ( previousSegment != null && ! TextSegment . MarkerIsInPrecedingContext ( UsfmMarkerType . Paragraph ) )
7676 {
7777 return new StringInfo ( previousSegment . Text ) . SubstringByTextElements (
78- previousSegment . Text . Length - 1 ,
78+ StringInfo . ParseCombiningCharacters ( previousSegment . Text ) . Length - 1 ,
7979 1
8080 ) ;
8181 }
Original file line number Diff line number Diff line change @@ -188,13 +188,24 @@ public void GetPreviousCharacter()
188188 0 ,
189189 1
190190 ) ;
191- ;
191+ Assert . IsNull ( quotationMarkStringMatch . PreviousCharacter ) ;
192+
192193 quotationMarkStringMatch = new QuotationMarkStringMatch (
193194 new TextSegment . Builder ( ) . SetText ( "\u201c \u201d " ) . Build ( ) ,
194195 1 ,
195196 2
196197 ) ;
197198 Assert . That ( quotationMarkStringMatch . PreviousCharacter , Is . EqualTo ( "“" ) ) ;
199+
200+ quotationMarkStringMatch = new QuotationMarkStringMatch (
201+ new TextSegment . Builder ( )
202+ . SetText ( "\" उत्पत्ति पुस्तकले" )
203+ . SetPreviousSegment ( new TextSegment . Builder ( ) . SetText ( "उत्पत्ति पुस्तकले" ) . Build ( ) )
204+ . Build ( ) ,
205+ 0 ,
206+ 1
207+ ) ;
208+ Assert . That ( quotationMarkStringMatch . PreviousCharacter , Is . EqualTo ( "ले" ) ) ;
198209 }
199210
200211 [ Test ]
You can’t perform that action at this time.
0 commit comments