PHP Classes

PHP Sentence Tokenizer: Parse sentences and extract their word features

Recommend this page to a friend!
     
  Info   Example   View files Files   Install with Composer Install with Composer   Download Download   Reputation   Support forum   Blog    
Ratings Unique User Downloads Download Rankings
Not yet rated by the usersTotal: 92 All time: 9,918 This week: 673Up
Version License PHP version Categories
sentence 1.0.0GNU Lesser Genera...5PHP 5, Text processing
Description 

Author

This package can parse sentences and extract their word features.

It takes a string of text and parses it to split several parts that are easier to analyze. Currently, it can:

- Break the string into sentence paragraphs

- Parse a sentence punctuation

- Find the frequency of work in a sentence

- Return a SQL string to insert words in a database table

- Rate a sentence according to the words that it uses

- Etc

Innovation Award
PHP Programming Innovation award nominee
October 2021
Number 10
Natural language processing is helpful to interpret phrases of users that wish to express their will using written or spoken language.

It is necessary to process a phrase to interpret its meaning. The interpretation of the phrase can start by breaking it into several parts that make it easier to interpret the meaning of each part of the phrase.

This package can parse phrases to make it easier to process them and interpret the meaning of the phrase as a whole.

Manuel Lemos
Picture of Guillermina Gonjon
Name: Guillermina Gonjon <contact>
Classes: 4 packages by
Country: United States United States
Age: ???
All time rank: 3423460 in United States United States
Week rank: 192 Up22 in United States United States Up
Innovation award
Innovation award
Nominee: 1x

Example

<!DOCTYPE html>
<html>
    <head>
        <meta charset="UTF-8">
        <title>Sentence</title>
        <link href="css/style.css" type="text/css" rel="stylesheet" rev="stylesheet" media="all">
    </head>
    <body>
      <h1>Sentence</h1>
      <h2>Add a sentence or group of sentences in the text box to see the parts of your sentences.</h2>
        <form name="sentence" method="get" action="index.php">
        <textarea name="add_sentence" class="sentence" value=""></textarea>
        <input type="submit" name="submit" value="Add">
        </form>
        <!-- Result -->
        <pre>
 
        </pre>
    </body>
</html>
       <?php
       
echo '<pre>';
       
       
print_r($_GET);
        if(isset(
$_GET['add_sentence']))
        {
           
$sentence = $_GET['add_sentence'];
        }else{
           
$sentence = "This is a book, and I love it! Minerba got it for me. Que maravilla! It's the best that could happen to me.";
            }
       
       
// put your code here
       
require_once("./Upload.php");
       
//require_once("./language/Words.php");
       
require_once("./language/SentenceElements.php");
        require_once(
"./language/WordRating.php");
       
       
$r = new WordRating();
       
$b = new SentenceElements();
       
//print_r($b->bindElements($sentence));
       
$sentences = $b->brakeParagraph($sentence);
        foreach(
$sentences as $value)
        {
           
print_r($b->sentenceBinder($value));
        }
       
$b->parsePunctuation($sentence);
       
$r->setWordIntensity();
       
$r->findFrequency("love");
       
$r->setWordFrequency("love");
       
var_dummp($r->getWordFrequency());
       
var_dump($r->getWordIntensity());
        echo
"<pre>";
$word = new Words();
$alphabet = array("A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z");
print
$word->insertWords();

       
//var_dump($r);

       
?>



Details

Language: Sentence: Word Detection

Sentence parts, and words identification Here are a few classes not yet related identifying the parts of a sentence, another accepts words and organize them into subject and predicative and later into sentence.

The current stage for this project is Alpha. <img src="https://raw.githubusercontent.com/gmanon/language/sentence/sentence/language_data/sentence_elements_finder.png" alt="language-sec:sentence element finder">

<h2>Sentence Builder class</h2> Sentence Builder builds sentences from given words. It would work together with the sentence elements filter. Once you have gother random words, you will pass it to sentence builder to build an organized sentence.


  Files folder image Files (20)  
File Role Description
Files folder image.github (1 directory)
Files folder imageDocs (6 files)
Files folder imagelanguage (7 files)
Accessible without login Plain text file CONTRIBUTING.md Data Auxiliary data
Accessible without login Plain text file index.php Example Example script
Accessible without login Plain text file LICENSE Lic. License text
Accessible without login Plain text file README.md Doc. Documentation
Plain text file SentenceBuilder.class.php Class Class source
Plain text file Upload.php Class Class source

  Files folder image Files (20)  /  .github  
File Role Description
Files folder imageISSUE_TEMPLATE (1 file)

  Files folder image Files (20)  /  .github  /  ISSUE_TEMPLATE  
File Role Description
  Accessible without login Plain text file bug_report.md Data Auxiliary data

  Files folder image Files (20)  /  Docs  
File Role Description
  Accessible without login Plain text file doc.txt Doc. Documentation
  Accessible without login Plain text file doc3.txt Doc. Documentation
  Accessible without login Plain text file listing.txt Doc. Documentation
  Accessible without login Plain text file remembering.txt Doc. Documentation
  Accessible without login Plain text file response.txt Doc. Documentation
  Accessible without login Plain text file sentence-type.txt Doc. Documentation

  Files folder image Files (20)  /  language  
File Role Description
  Plain text file ArticleDecoder.class.php Class Class source
  Accessible without login Plain text file index.html Data Empty HTML file
  Plain text file InsertWords.php Class Class source
  Plain text file PronounDecoder.class.php Class Class source
  Plain text file SentenceElements.php Class Class source
  Plain text file WordRating.php Class Class source
  Plain text file Words.php Class Class source

The PHP Classes site has supported package installation using the Composer tool since 2013, as you may verify by reading this instructions page.
Install with Composer Install with Composer
 Version Control Unique User Downloads Download Rankings  
 100%
Total:92
This week:0
All time:9,918
This week:673Up