Translating source locale input string to target locale output string
First Claim
1. A method to translate an input string having a source locale to an output string having a target locale comprising:
- constructing, by a processor of a computing device, a dictionary mapping source locale strings of the source locale to target locale strings of the target locale;
constructing, by the processor, a tree from the dictionary, the tree having a plurality of nodes including a start node, one or more end nodes, and one or more string nodes, the nodes forming one or more node chains of the tree, the node chains corresponding to the source locale strings,each node chain linking a collection of the nodes from the start node to one of the string nodes, each node within the collection of the nodes being linked to another node within the collection of nodes,each node other than the start node having a parent node, each node other than the start node corresponding to a character of the source locale strings;
each node other than the end nodes having one or more child nodes,each string node ending one of the node chains of the tree, each string node corresponding to a mapping within the dictionary of one of the source locale strings to one of the target locale strings;
processing, by the processor, the input string against the tree to generate the output string, the input string having a plurality of characters, the characters processed on a character-by-character basis against the tree to match each sub-plurality of one or more sub-pluralities of the characters to one of the node chains within the tree to translate the sub-plurality of the characters from the source locale to the target locale; and
,outputting, by the processor, the output string,wherein processing the input string against the tree comprises;
for each character of the input string,appending the character to a read buffer;
processing one or more active states based on the character,where each active state represents a procession through the tree such that the procession encompasses a linked number of the nodes of the tree matching previous characters of the input string that have already been processed,where processing the active states results in a first list of new states;
clearing the active states;
setting the new states within the first list as the active states;
creating a new state representing the start node and processing new state based on the character in a same manner in which the active states are processed based on the character, where processing the new state results in a second list of new states;
adding the new states within the second list to the active states;
pruning the active states;
where there are no active states after pruning, processing one or more completed states,where each completed state represents a procession through the tree corresponding to one of the node chains ending in one of the string nodes,where processing the completed states results in translation of one of the sub-pluralities of the characters of the input string from the source locale to the target locale within the output string;
otherwise, where there are active states after pruning,determining one or more candidate states, where each candidate state represents a completed state;
processing the candidate states in a same manner in which the completed states are processed;
performing a replace operation in relation to the completed states; and
,writing any remaining characters within the read buffer to the output string.
1 Assignment
0 Petitions
Accused Products
Abstract
A dictionary mapping source locale strings to target locale strings is constructed. A tree is constructed from the dictionary. The tree has nodes including a start node, end nodes, and string nodes. The nodes form node chains of the tree that correspond to the source locale strings. Each node chain links a collection of the nodes from the start node to a string node. Each node other than the start node has a parent node and corresponds to a character of the source locale strings. Each node other than the end nodes has one or more child nodes. Each string node ends a node chain, and corresponds to a mapping within the dictionary of a source locale string to a target locale string. An input string having the source locale is processed against the tree to generate an output string having the target locale.
-
Citations
19 Claims
-
1. A method to translate an input string having a source locale to an output string having a target locale comprising:
-
constructing, by a processor of a computing device, a dictionary mapping source locale strings of the source locale to target locale strings of the target locale; constructing, by the processor, a tree from the dictionary, the tree having a plurality of nodes including a start node, one or more end nodes, and one or more string nodes, the nodes forming one or more node chains of the tree, the node chains corresponding to the source locale strings, each node chain linking a collection of the nodes from the start node to one of the string nodes, each node within the collection of the nodes being linked to another node within the collection of nodes, each node other than the start node having a parent node, each node other than the start node corresponding to a character of the source locale strings; each node other than the end nodes having one or more child nodes, each string node ending one of the node chains of the tree, each string node corresponding to a mapping within the dictionary of one of the source locale strings to one of the target locale strings; processing, by the processor, the input string against the tree to generate the output string, the input string having a plurality of characters, the characters processed on a character-by-character basis against the tree to match each sub-plurality of one or more sub-pluralities of the characters to one of the node chains within the tree to translate the sub-plurality of the characters from the source locale to the target locale; and
,outputting, by the processor, the output string, wherein processing the input string against the tree comprises; for each character of the input string, appending the character to a read buffer; processing one or more active states based on the character, where each active state represents a procession through the tree such that the procession encompasses a linked number of the nodes of the tree matching previous characters of the input string that have already been processed, where processing the active states results in a first list of new states; clearing the active states; setting the new states within the first list as the active states; creating a new state representing the start node and processing new state based on the character in a same manner in which the active states are processed based on the character, where processing the new state results in a second list of new states; adding the new states within the second list to the active states; pruning the active states; where there are no active states after pruning, processing one or more completed states, where each completed state represents a procession through the tree corresponding to one of the node chains ending in one of the string nodes, where processing the completed states results in translation of one of the sub-pluralities of the characters of the input string from the source locale to the target locale within the output string; otherwise, where there are active states after pruning, determining one or more candidate states, where each candidate state represents a completed state; processing the candidate states in a same manner in which the completed states are processed; performing a replace operation in relation to the completed states; and
,writing any remaining characters within the read buffer to the output string. - View Dependent Claims (2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16)
-
-
17. A system for translating an input string having a source locale to an output string having a target locale, the system comprising:
-
hardware; a dictionary-construction component implemented at least by the hardware, the dictionary-construction component to construct a dictionary by mapping source locale strings of the source locale to target locale strings of the target locale; a tree-construction component implemented at least by the hardware, the tree-construction component to construct a tree from the dictionary, the tree having a plurality of nodes including a start node, one or more end nodes, and one or more string nodes, the nodes forming one or more node chains of the tree, the node chains corresponding to the source locale strings, each node chain linking a collection of the nodes from the start node to one of the string nodes, each node within the collection of the nodes being linked to another node within the collection of nodes, each node other than the start node having a parent node, each node other than the start node corresponding to a character of the source locale strings; each node other than the end nodes having one or more child nodes, each string node ending one of the node chains of the tree, each string node corresponding to a mapping within the dictionary of one of the source locale strings to one of the target locale strings; and
,a translation component implemented at least by the hardware to process the input string against the tree to generate the output string, the input string having a plurality of characters, the translation component to process the characters on a character-by-character basis against the tree to match each sub-plurality of one or more sub-pluralities of the characters to one of the node chains within the tree to translate the sub-plurality of the characters from the source locale to the target locale, wherein the translation component is to process the input string against the tree by; for each character of the input string, appending the character to a read buffer; processing one or more active states based on the character, where each active state represents a procession through the tree such that the procession encompasses a linked number of the nodes of the tree matching previous characters of the input string that have already been processed, where processing the active states results in a first list of new states; clearing the active states; setting the new states within the first list as the active states; creating a new state representing the start node and processing the new state based on the character in a same manner in which the active states are processed based on the character, where processing the new state results in a second list of new states; adding the new states within the second list to the active states; pruning the active states; where there are no active states after pruning, processing one or more completed states, where each completed state represents a procession through the tree corresponding to one of the node chains ending in one of the string nodes, where processing the completed states results in translation of one of the sub-pluralities of the characters of the input string from the source locale to the target locale within the output string; otherwise, where there are active states after pruning, determining one or more candidate states, where each candidate state represents a completed state; processing the candidate states in a same manner in which the completed states are processed; performing a replace operation in relation to the completed states; and
,writing any remaining characters within the read buffer to the output string. - View Dependent Claims (18)
-
-
19. A computer-readable medium having one or more computer programs stored thereon for execution by one or more processors to perform a method to translate an input string having a source locale to an output string having a target locale comprising:
-
constructing a dictionary mapping source locale strings of the source locale to target locale strings of the target locale; constructing a tree from the dictionary, the tree having a plurality of nodes including a start node, one or more end nodes, and one or more string nodes, the nodes forming one or more node chains of the tree, the node chains corresponding to the source locale strings, each node chain linking a collection of the nodes from the start node to one of the string nodes, each node within the collection of the nodes being linked to another node within the collection of nodes, each node other than the start node having a parent node, each node other than the start node corresponding to a character of the source locale strings; each node other than the end nodes having one or more child nodes, each string node ending one of the node chains of the tree, each string node corresponding to a mapping within the dictionary of one of the source locale strings to one of the target locale strings; and
,processing the input string against the tree to generate the output string, the input string having a plurality of characters, the characters processed on a character-by-character basis against the tree to match each sub-plurality of one or more sub-pluralities of the characters to one of the node chains within the tree to translate the sub-plurality of the characters from the source locale to the target locale, wherein processing the input string against the tree comprises; for each character of the input string, appending the character to a read buffer; processing one or more active states based on the character, where each active state represents a procession through the tree such that the procession encompasses a linked number of the nodes of the tree matching previous characters of the input string that have already been processed, where processing the active states results in a first list of new states; clearing the active states; setting the new states within the first list as the active states; creating a new state representing the start node and processing the new state based on the character in a same manner in which the active states are processed based on the character, where processing the new state results in a second list of new states; adding the new states within the second list to the active states; pruning the active states; where there are no active states after pruning, processing one or more completed states, where each completed state represents a procession through the tree corresponding to one of the node chains ending in one of the string nodes, where processing the completed states results in translation of one of the sub-pluralities of the characters of the input string from the source locale to the target locale within the output string; otherwise, where there are active states after pruning, determining one or more candidate states, where each candidate state represents a completed state; processing the candidate states in a same manner in which the completed states are processed; performing a replace operation in relation to the completed states; and
,writing any remaining characters within the read buffer to the output string.
-
Specification