27#include "Converter.hpp"
29#include "StreamWindow.hpp"
68 std::vector<std::string> sources;
69 std::vector<AmbiguousSpan> ambiguities;
100ConvertWithAmbiguities(
const Converter& converter, std::string_view text);
117class OPENCC_EXPORT AmbiguityStream {
121 std::vector<AmbiguousSpan> ambiguities;
122 std::vector<std::string> newSources;
129 explicit AmbiguityStream(
130 ConverterPtr converter,
131 size_t maxKeepChars = internal::kDefaultStreamKeepChars);
147 Chunk ConvertWindow(std::string_view window);
150 std::unique_ptr<Impl> impl;
Chunk ConvertChunk(std::string_view input)
Appends input and flushes everything but the kept tail.
Definition ConversionAmbiguities.cpp:338
size_t SourceCount() const
Number of distinct sources defined so far.
Definition ConversionAmbiguities.cpp:305
Chunk Finish(std::string_view input)
Appends input and flushes everything, ending the stream.
Definition ConversionAmbiguities.cpp:355
Abstract base for full-text converters.
Definition Converter.hpp:48
Definition ConversionAmbiguities.hpp:119
bool analyzed
Mirrors AnnotatedConversion::analyzed: false when the underlying converter could not be analyzed (no ...
Definition ConversionAmbiguities.hpp:126
One span of the converted output whose source maps to more than one candidate (a one-to-many dictiona...
Definition ConversionAmbiguities.hpp:46
Result of ConvertWithAmbiguities(): the converted text plus the spans where the conversion is one-to-...
Definition ConversionAmbiguities.hpp:66
bool analyzed
False when the converter could not be analyzed (no single conversion chain, e.g.
Definition ConversionAmbiguities.hpp:73