Open Chinese Convert 1.3.2
A project for conversion between Traditional and Simplified Chinese
Loading...
Searching...
No Matches
opencc::Segmentation Class Referenceabstract

Abstract base for text segmentation. More...

#include <Segmentation.hpp>

Inheritance diagram for opencc::Segmentation:
opencc::JiebaSegmentation opencc::MaxMatchSegmentation

Public Member Functions

virtual SegmentsPtr Segment (std::string_view text) const =0
 Splits text into segments and returns them.
SegmentsPtr Segment (const char *text) const
 Convenience overload for null-terminated C strings.
SegmentsPtr Segment (const std::string &str) const
 Convenience overload for std::string.

Detailed Description

Abstract base for text segmentation.

Splits a UTF-8 string into an ordered list of segments. Each segment is either a dictionary-matched word or a single unmatched code point / IDS sequence. The primary virtual is Segment(std::string_view); the const char* and const std::string& overloads are non-virtual convenience adapters that forward to it.

Member Function Documentation

◆ Segment()

virtual SegmentsPtr opencc::Segmentation::Segment ( std::string_view text) const
pure virtual

Splits text into segments and returns them.

This is the primary override point for subclasses.

Implemented in opencc::JiebaSegmentation, and opencc::MaxMatchSegmentation.


The documentation for this class was generated from the following files: