djunehor/laravel-grammar
Composer 安装命令:
composer require djunehor/laravel-grammar
包简介
deduce part of speech of a word
README 文档
README
Laravel Grammar allows you detect the part of speech of a word. It returns an array of parts of speech a word belong to.
Installation
Step 1
You can install the package via composer:
composer require djunehor/laravel-grammar
Laravel 5.5 and above
The package will automatically register itself, so you can start using it immediately.
Laravel 5.4 and older
In Laravel version 5.4 and older, you have to add the service provider in config/app.php file manually:
'providers' => [ // ... Djunehor\Grammar\GrammarServiceProvider::class, ];
Lumen
After installing the package, you will have to register it in bootstrap/app.php file manually:
// Register Service Providers // ... $app->register(Djunehor\Grammar\GrammarServiceProvider::class); ];
Step 2 - Publishing files
Run:
php artisan vendor:publish --tag=laravel-grammar
This will move the migration file, seeder file and config file to your app. You can change the entries table name in config/laravel-grammar.php
Step 3 - Publishing files
- Run
php artisan migrateto create the table. - Run
php artisan db:seed --class=LaravelGrammarSeederto seed table
Usage
use Djunehor\Grammar\Word;` $grammar = new Word();
Get All Parts of Speech
$partsOfSpeech = $grammar->getPartsOfSpeech(); // ['Preposition', 'Noun', 'Pronoun', 'Adverb', 'Adjective', 'Verb', 'Interjection', 'Conjunction']
Get Word part of Speech
$word = 'boy'; $partsOfSpeech = $grammar->getWordPartOfSpeech($word); // ['Noun']
Check if is noun
$word = 'boy'; $grammar = new Word($string); $isNoun = $grammar->isNoun(); // true
Using Facade
In order to use the Grammar facade:
- First add
'Grammar' => GrammarFacade::class,to aliases inconfig/app.php - Then use like
\Grammar::getPartsOfSpeech();
Contributing
- Fork this project
- Clone to your repo
- Make your changes and run tests
composer test - Push and create Pull request
djunehor/laravel-grammar 适用场景与选型建议
djunehor/laravel-grammar 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 63 次下载、GitHub Stars 达 4, 最近一次更新时间为 2019 年 11 月 22 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「php」 「laravel」 「grammar」 「english」 「part of speech」 「djunehor」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 djunehor/laravel-grammar 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 djunehor/laravel-grammar 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 djunehor/laravel-grammar 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
A simple library for make Lexer and Parsers to build a language
Preposition replace library
Convert english to ipa
Syntax-highlighting grammars for the Carve markup language (TextMate grammar for Torchlight / phiki, plus Prism and highlight.js definitions)
Alfabank REST API integration
This library provides a huge dataset of german words and their grammar rules
统计信息
- 总下载量: 63
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 5
- 点击次数: 14
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2019-11-22