Loading...
Searching...
No Matches
opencc::Segmentation Class Referenceabstract
OpenCC C++ Comprehensive API

Abstract base for text segmentation. More...

`#include <src/Segmentation.hpp>`

Inheritance diagram for opencc::Segmentation:

## 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:

- Segmentation.hpp
- Segmentation.cpp