|
Open Chinese Convert 1.4.0
A project for conversion between Traditional and Simplified Chinese
|
A Converter produced by loading a JSON config that includes a normalization pre-pass.
More...
#include <ConfigBasedConverter.hpp>
Public Member Functions | |
| ConfigBasedConverter (ConverterPtr normConverter, ConverterPtr mainConverter) | |
| std::string | Convert (std::string_view text) const override |
Converts text and returns the result. | |
| ConversionInspectionResult | Inspect (std::string_view text) const override |
Converts text and returns a detailed inspection result that includes the initial segmentation, per-stage intermediate segments, and final output. | |
| SegmentationPtr | GetSegmentation () const override |
Returns the segmentation used by this converter, or nullptr if the converter has no single segmentation (e.g. | |
| ConversionChainPtr | GetConversionChain () const override |
Returns the conversion chain used by this converter, or nullptr if the converter has no single chain (e.g. | |
A Converter produced by loading a JSON config that includes a normalization pre-pass.
Internally it runs normConverter then mainConverter, exactly like a two-stage PipelineConverter. The difference is that GetConversionChain() and GetSegmentation() delegate to mainConverter rather than returning nullptr, so that external consumers (e.g. librime) that introspect the converter see the config's primary conversion chain instead of a null pointer.
|
inlineoverridevirtual |
Converts text and returns the result.
| text | UTF-8 input; need not be null-terminated. |
Implements opencc::Converter.
|
inlineoverridevirtual |
Returns the conversion chain used by this converter, or nullptr if the converter has no single chain (e.g.
Implements opencc::Converter.
|
inlineoverridevirtual |
Returns the segmentation used by this converter, or nullptr if the converter has no single segmentation (e.g.
Implements opencc::Converter.
|
inlineoverridevirtual |
Converts text and returns a detailed inspection result that includes the initial segmentation, per-stage intermediate segments, and final output.
Intended for debugging and tooling rather than production conversion.
Implements opencc::Converter.