Documentation

TextParsingService

Service class for text parsing operations.

Tags
category

Lwt

author

HugoFara hugo.farajallah@protonmail.com

license

Unlicense http://unlicense.org/

link
https://hugofara.github.io/lwt/docs/php/
since
3.0.0

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
since
2.3.1-fork

Much more verifications added

since
3.0.0

Support for Mac OS added

Return values
string

OS-compatible command


        
On this page

Search results