×

Translating source locale input string to target locale output string

  • US 8,296,125 B2
  • Filed: 10/17/2008
  • Issued: 10/23/2012
  • Est. Priority Date: 10/17/2008
  • Status: Expired due to Fees
First Claim
Patent Images

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 all claims
  • 1 Assignment
Timeline View
Assignment View
    ×
    ×