Hybrid comparison for unicode text strings consisting primarily of ASCII characters
AssigneeTableau Software, Inc.
InventorsThomas Neumann, Viktor Leis, Alfons Kemper
Life of this patent
Estimating the term…
Abstract
A method compares text strings having Unicode encoding. The method receives a first string S=s1s2 . . . sn and a second string T=t1t2 . . . tm, where s1, s2, . . . , sn and t1, t2, . . . , tm are 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 includes one or more non-replaceable non-ASCII characters, the first string weight ƒ(S) is a concatenation of an ASCII weight prefix ƒA(S) and a Unicode weight suffix ƒU(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.
Claims20
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:
- receiving a first text string S=s1s2 . . . sn having Unicode encoding and a second text string T=t1t2 . . . tm having Unicode encoding, wherein n and m are positive integers, and s1 s2, . . . , sn and t1, t2, . . . , tm are Unicode characters;
- computing, for the first text string S, a first string weight ƒ(S) according to a weight function ƒ, computed according to:
- when it is determined that S consists entirely of ASCII characters, ƒ(S)=S;
- and
- when S includes one or more non-replaceable non-ASCII characters, the first string weight ƒ(S) is a concatenation of an ASCII weight prefix ƒA(S) and a Unicode weight suffix ƒu(S);
- computing, a second string weight ƒ(T), for the second text string T, according to the weight function ƒ;
- and
- determining whether the first text string and the second text string are equal by comparing the first string weight to the second string weight.
A computing device, comprising:
- one or more processors;
- memory;
- and
- one or more programs stored in the memory and configured for execution by the one or more processors, the one or more programs comprising instructions for:
- receiving a first text string S=s1s2 . . . sn having Unicode encoding and a second text string T=t1t2 . . . tm having Unicode encoding, wherein n and m are positive integers, and s1 s2, . . . , sn and t1, t2, . . . , tm are Unicode characters;
- computing, for the first text string S, a first string weight ƒ(S) according to a weight function ƒ, computed according to:
- when it is determined that S consists entirely of ASCII characters, ƒ(S)=S;
- and
- when S includes one or more non-replaceable non-ASCII characters, the first string weight ƒ(S) is a concatenation of an ASCII weight prefix ƒA(S) and a Unicode weight suffix ƒu(S);
- computing, a second string weight ƒ(T), for the second text string T, according to the weight function ƒ;
- and
- determining whether the first text string and the second text string are equal by comparing the first string weight to the second string weight.
A non-transitory computer readable storage medium storing one or more programs configured for execution by a computing device having one or more processors and memory, the one or more programs comprising instructions for:
- receiving a first text string S=s1s2 . . . sn having Unicode encoding and a second text string T=t1t2 . . . tm having Unicode encoding, wherein n and m are positive integers, and s1 s2, . . . , sn and t1, t2, . . . , tm are Unicode characters;
- computing, for the first text string S, a first string weight ƒ(S) according to a weight function ƒ, computed according to:
- when it is determined that S consists entirely of ASCII characters, ƒ(S)=S;
- and
- when S includes one or more non-replaceable non-ASCII characters, the first string weight ƒ(S) is a concatenation of an ASCII weight prefix ƒA(S) and a Unicode weight suffix ƒu(S);
- computing, a second string weight ƒ(T), for the second text string T, according to the weight function ƒ;
- and
- determining whether the first text string and the second text string are equal by comparing the first string weight to the second string weight.
Dependencies are inferred from the claim text.