30-04-2020 дата публикации
Номер: US20200134254A1
Принадлежит:
A method compares text strings having Unicode encoding. The method receives a first string S=ss. . . sand a second string T=tt. . . t, where s, s, . . . , sand t, t, . . . , tare Unicode characters. The method computes a first string weight for the first string S according to a weight function ƒ. When S consists of ASCII characters, ƒ(S)=S. When S consists of ASCII characters and some accented ASCII characters that are replaceable by ASCII characters, ƒ(S)=g(s)g(s) . . . g(s), where g(s)=swhen sis an ASCII character and g(s)=s′when sis an accented ASCII character that is replaceable by the corresponding ASCII character s′. The method also computes a second string weight for the second text string T. Equality of the strings is tested using the string weights. 1. A method of comparing text strings having Unicode encoding , comprising:at a computer having one or more processors, and memory storing one or more programs configured for execution by the one or more processors:{'sub': 1', '2', 'n', '1', '2', 'm', '1', '2', 'n', '1', '2', 'm, 'receiving a first text string S=ss. . . s, having Unicode encoding and a second text string T=tt. . . thaving Unicode encoding, wherein n and m are positive integers, and s, s, . . . , sand t, t, . . . , tare Unicode characters;'} when it is determined that S consists entirely of ASCII characters, ƒ(S)=S; and', {'sub': 1', '2', 'n', 'i', 'i', 'i', 'i', 'i', 'i', 'i, 'when it is determined that S consists of ASCII characters and one or more accented ASCII characters that are replaceable by corresponding ASCII characters, ƒ(S)=g(s)g(s) . . . g(s), wherein g(s)=swhen sis an ASCII character and g(s)=s′when sis an accented ASCII character that is replaceable by the corresponding ASCII character s;'}], 'computing, for the first text string S, a first string weight ƒ(S) according to a weight function ƒ, computed according tocomputing, a second string weight ƒ(T), for the second text string T, according to the weight function ƒ; anddetermining ...
Подробнее