TextParsingService
in package
Service class for text parsing operations.
Tags
Table of Contents
Methods
- findLatinSentenceEnd() : string
- Find end-of-sentence characters in a sentence using latin alphabet.
- getMecabPath() : string
- Returns path to the MeCab application.
Methods
findLatinSentenceEnd()
Find end-of-sentence characters in a sentence using latin alphabet.
public
findLatinSentenceEnd(array<string|int, string> $matches, string $noSentenceEnd) : string
Parameters
- $matches : array<string|int, string>
-
All the matches from a capturing regex
- $noSentenceEnd : string
-
If different from '', can declare that a string is not the end of a sentence.
Return values
string —$matches[0] with ends of sentences marked with \t and \r.
getMecabPath()
Returns path to the MeCab application.
public
getMecabPath([string $mecabArgs = '' ]) : string
MeCab can split Japanese text word by word
Parameters
- $mecabArgs : string = ''
-
Arguments to add
Tags
Return values
string —OS-compatible command