laragrad/str-trgm 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

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

laragrad/str-trgm

Composer 安装命令:

composer require laragrad/str-trgm

包简介

README 文档

README

A package to compare two string with trigramm algorithm like as PostgreSql pg_trgm package similarity() function.

Installing

Run command in console

composer require laragrad/str-trgm

Functions

All functions are static.

similarity()

Return similarity value (0..1) for two strings.

Syntax:

similarity(string $text1, string $text2) : float

Arguments:

  • $text1 - First word or sentense
  • $text2 - Second word or sentense

Returns a value of similarity in range from 0 to 1.

getSentenceTrgms

Returns an array of trigramms for sentense.

Syntax:

getSentenceTrgms(string $text) : array

Arguments:

  • $text - Sentense string

Returns an array of trigramms.

getWordTrgms

Returns an array of trigramms for word.

Syntax:

getWordTrgms(string $text) : array

Arguments:

  • $text - Word string

Returns array of trigramms.

normalizeSentense()

Function normalizes a string.

  • convert string to lower case,
  • replace any symbols by space,
  • replace double spaces by single space.

Syntax:

normalizeSentence(string $text) : string

Arguments:

  • $text - Source string

Returns normalized string.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2020-06-26

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固