承接 bitandblack/word-extract 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

bitandblack/word-extract

Composer 安装命令:

composer require bitandblack/word-extract

包简介

Extract or handle words with a given minimum length.

README 文档

README

PHP from Packagist Total Downloads License

Bit&Black Logo

Bit&Black Word Extract

Extract or handle words with a given minimum length.

Installation

This library is written in PHP and made for the use with Composer. Be sure to have both of them installed on your system.

Add the library then to your project by running $ composer require bitandblack/word-extract.

Usage

Initialise the WordExtractor class with the minimum number of letters that the words to be extracted should have:

<?php

use BitAndBlack\WordExtract\WordExtractor;

$wordExtractor = new WordExtractor(10);

Extract the words from a given string then:

<?php

$sentence = 'Herzlich willkommen in meinem Rosengarten';

$words = $wordExtractor->getWords($sentence);

/**
 * This will dump
 * 
 * array(2) {
 *     [0]=> string(10) "willkommen"
 *     [1]=> string(11) "Rosengarten"
 * }
 */
var_dump($words);

Or use a callback to handle each of the extracted words:

<?php

$sentence = 'Herzlich willkommen in meinem Rosengarten';

$handler = static function (string $word): string {
    return '[' . $word . ']';
};

$sentenceHandled = $wordExtractor->getWithWordsHandled($sentence, $handler);

/**
 * This will dump
 * 
 * string(45) "Herzlich [willkommen] in meinem [Rosengarten]"
 */
var_dump($sentenceHandled);

Help

If you have any questions feel free to contact us under hello@bitandblack.com.

Further information about Bit&Black can be found under www.bitandblack.com.

统计信息

  • 总下载量: 514
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 1
  • 点击次数: 1
  • 依赖项目数: 1
  • 推荐数: 0

GitHub 信息

  • Stars: 1
  • Watchers: 0
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2026-02-10

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固