PHP Classes

File: simple_example.php

Recommend this page to a friend!
  Classes of Arturs Sosins   Proper nouns   simple_example.php   Download  
File: simple_example.php
Role: Example script
Content type: text/plain
Description: Simple usage example
Class: Proper nouns
Extract proper nouns from texts
Author: By
Last change:
Date: 12 years ago
Size: 1,548 bytes


Class file image Download
 * This script is developed by Arturs Sosins aka ar2rsawseen,
 * Feel free to distribute and modify code, but keep reference to its creator
 * Proper nouns class can find and extract proper nouns from given text
 * using heuristics based on syntactic clues like
 * first letter uppercased, word position in sentence, etc.
 * For more information, examples and online documentation visit:
//sample text
$text = "My dear Mr. Bennet, said his lady to him one day,have you heard that Netherfield Park in London is let at last?
Mr. Bennet replied that he had not.
But it is, returned she for Mrs. Long has just been here, and she told me and Jane all about it.
Mr. Bennet made no answer. His wife cried impatiently. Even the kind Dr. Smith knew better. Mr. Bennet was so odd a mixture of quick
parts, sarcastic humour, reserve, and caprice, that the experience of three-and-twenty years living in England had been insufficient to
make his wife understand his character. Her mind, like her sister Lizzy's, was less difficult to develop."


//create instance
$pn = new proper_nouns();

//get array with proper nouns
$arr = $pn->get($text);

//output text
echo $text."\n";
//print result