|
Open Chinese Convert 1.4.2
A project for conversion between Traditional and Simplified Chinese
|
Result of ConvertWithAmbiguities(): the converted text plus the spans where the conversion is one-to-many. More...
#include <src/ConversionAmbiguities.hpp>
Public Attributes | |
| std::string | output |
| std::vector< std::string > | sources |
| std::vector< AmbiguousSpan > | ambiguities |
| bool | analyzed = true |
| False when the converter could not be analyzed (no single conversion chain, e.g. | |
Result of ConvertWithAmbiguities(): the converted text plus the spans where the conversion is one-to-many.
output is byte-identical to Converter::Convert() on the same input. sources holds the deduplicated input slices that produced ambiguous spans, in order of first appearance; input text repeats heavily in practice, so spans reference sources by index instead of embedding a copy (and callers can memoize GetAllConversions() per unique source). ambiguities is sorted by outputOffset and spans do not overlap.
For a converter with a normalization pre-pass (e.g. s2t.json), sources are slices of the normalized input, mirroring GetAllConversions().
| bool opencc::AnnotatedConversion::analyzed = true |
False when the converter could not be analyzed (no single conversion chain, e.g.
PipelineConverter): output is still the plain conversion result, but empty ambiguities then means "unknown", not "none".