Patent ID: 7437284

Claim:
A method of detecting boundaries between languages in a body of text containing at least two languages, the method comprising: receiving a buffer containing text, determining the location of word-like boundaries in the text by executing an algorithm for determining boundaries between logical units in text, determining script boundaries in the text by executing a script boundary algorithm, determining the location of sentence-like boundaries by executing an algorithm for determining boundaries between logical units in text, comparing a defined profile depth to the total size of the buffer, the profile depth being a maximum number of characters to be examined in detecting the language, if the profile depth is substantially the same size as the entire buffer, executing a single-language detector on the buffer, if execution of the single-language detector yields an unambiguous result for a detected language, then recording the detected language as the predominant language of the text, setting a current start index to zero, setting a current end index to a first determined sentence boundary, defining a current length to be current end index minus current start index, comparing the current length to a defined minimum region size, the minimum region size being defined as a minimum amount of text to be analyzed at one time, if the current length is smaller than the minimum region size, then advancing the current end index, and if the current end index is not at the end of the buffer, advancing the current end index to the next sentence boundary and returning to the setting of a current start index, applying the single-language detector to the region of text defined by the current start index and current end index, if the region size is greater than a defined scan window size, the scan window size being defined as an amount of text to examine when checking a region for sub-regions, then invoking a window algorithm to check for sub-regions, if the current end index is at the end of the buffer, stopping execution, or, if the current end index is not at the end of the buffer, then moving the current start index to the current end index, moving the current end index to the next sentence boundary, and returning to the step of defining a current length.