2017 © Pedro Peláez
 

library text-scoring

image

timostamm/text-scoring

  • Tuesday, October 3, 2017
  • by timostamm
  • Repository
  • 1 Watchers
  • 0 Stars
  • 4 Installations
  • Puppet
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 1 Versions
  • 33 % Grown

The README.md

PHP Text Scoring Library

This Library scores an input text based on weighted keywords., (*1)

It can be used to associate a selection of interests with a bunch of keywords and evaluate the relevance of a given text., (*2)

Example


// We setup our keywords. // If "VW" is present in the text, add 10 points to the score. // If "Stammmarke" is present in the text, add 5 points to the score. $criteria = [ new TextScoreKeyword('VW', 10), new TextScoreKeyword('Stammmarke', 5) ]; // This is our example text. It contains both keywords, // so it should score 15 points. $txt = 'Volkswagen (Abkürzung VW) ist die Stammmarke der Volkswagen AG.'; $scorer = new TextScorer($criteria); $score = $scorer->score($txt); print $score; // => 15

The Versions

03/10 2017

dev-master

9999999-dev

  Sources   Download

AGPL-3.0

The Requires

  • php >=7.1

 

The Development Requires