pherserk/text-keywords-ex

一个用于从纯文本中提取关键字的php工具

dev-master 2016-07-24 15:49 UTC

This package is not auto-updated.

Last update: 2024-09-26 01:55:49 UTC


README

PeriodSplitter

PeriodSplitter的主要目的是将句子按意义单位进行分割。句子是位于标点符号和/或通用换行符之间的文本部分。

基本用法

<?php

$units = PeriodSplitter::split('This is a text, this text will be splitted in units.\n Exactly three units ...excuse me four!')

var_dump($units);

KeywordsExtractor

关键词提取器的范围是按照给定的长度将文本分割成词组。最佳用法是使用PeriodSplitter分割文本,然后从之前提取的任何单元中提取关键词;

基本用法

<?php

$couples = KeywordsExtractor::extract('This text will be divided in couples of keywords', 2);

var_dump($couples);

$triples = KeywordsExtractor::extract('This text will be divided in triples of keywords', 3);

var_dump($triples);