File tree Expand file tree Collapse file tree 2 files changed +10
-2
lines changed Expand file tree Collapse file tree 2 files changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -176,7 +176,7 @@ export class AC {
176
176
if ( surname === "off" ) {
177
177
return item . priority !== Priority . Surname ;
178
178
} else if ( surname === "head" ) {
179
- return i === 0 ;
179
+ return item . length - 1 - i === 0 ;
180
180
} else {
181
181
return true ;
182
182
}
@@ -193,7 +193,7 @@ export class AC {
193
193
if ( surname === "off" ) {
194
194
return item . priority !== Priority . Surname ;
195
195
} else if ( surname === "head" ) {
196
- return i === 0 ;
196
+ return item . length - 1 - i === 0 ;
197
197
} else {
198
198
return true ;
199
199
}
Original file line number Diff line number Diff line change @@ -46,4 +46,12 @@ describe("surname", () => {
46
46
"zēng jīng cāng hǎi nán wèi shuǐ hǎo hǎo xué xí lè"
47
47
) ;
48
48
} ) ;
49
+
50
+ it ( "[surname]surname head double" , ( ) => {
51
+ const result = pinyin ( "令狐冲" , { surname : "head" } ) ;
52
+ expect ( result ) . to . be . equal ( "líng hú chōng" ) ;
53
+
54
+ const result1 = pinyin ( "万俟英" , { surname : "head" } ) ;
55
+ expect ( result1 ) . to . be . equal ( "mò qí yīng" ) ;
56
+ } ) ;
49
57
} ) ;
You can’t perform that action at this time.
0 commit comments