|
Open Chinese Convert 1.3.2+gad37fd0a6.dirty
A project for conversion between Traditional and Simplified Chinese
|
Public Member Functions | |
| ConverterStream (ConverterPtr converter, size_t maxKeepChars=16) | |
| std::string | ConvertChunk (std::string_view input) |
Appends input to pending, then emits everything up to the last maxKeepChars code points (extended if an incomplete IDS is detected). | |
| std::string | Finish (std::string_view input) |
Appends input to pending and flushes everything at once. | |
| std::string | Finish () |
|
inlineexplicit |
| converter | The converter applied to each flushed chunk. |
| maxKeepChars | Number of Unicode code points (not bytes) to retain at the end of the pending buffer after each ConvertChunk() call, so that a phrase or IDS straddling two consecutive chunks is not split across separate Convert() invocations. Defaults to 16 code points. |
| std::string ConverterStream::ConvertChunk | ( | std::string_view | input | ) |
Appends input to pending, then emits everything up to the last maxKeepChars code points (extended if an incomplete IDS is detected).
The kept tail remains in pending so that a phrase or IDS spanning two consecutive calls is not split across separate Convert() invocations.
| std::string ConverterStream::Finish | ( | std::string_view | input | ) |
Appends input to pending and flushes everything at once.
input) + Finish(): ConvertChunk applies the keepStart window and issues two Convert() calls, which breaks phrase or IDS matches that span the boundary. Use this overload for the final chunk when no more data is coming.