Analyzer
[ class tree: Analyzer ] [ index: Analyzer ] [ all elements ]

Class: Mai_Analyzer_Words

Source Location: /Mai/Analyzer/Words.php

Class Overview


Mai_Analyzer_Words is an sentence analyzer. It compares words with defined sources.


Author(s):

  • Wouter Bulten (wouterbulten@mai-ai.org)

Copyright:

  • Copyright (C) 2009 Mai (Me Artificial Intelligence)

Implements interfaces:

Variables

Methods



Class Details

[line 44]
Mai_Analyzer_Words is an sentence analyzer. It compares words with defined sources.



Tags:

author:  Wouter Bulten (wouterbulten@mai-ai.org)
copyright:  Copyright (C) 2009 Mai (Me Artificial Intelligence)
link:  http://www.launchpad.net/mai
license:  GNU General Public License version 3 (GPLv3)


[ Top ]


Class Variables

$_sentenceMark =

[line 64]



Tags:

var:  Contains the punctuation mark.
access:  private

Type:   string


[ Top ]

$_sources = array()

[line 69]



Tags:

var:  An array with different input sources.
access:  private

Type:   array


[ Top ]

$_storageType =  Mai::STORAGE_TYPE_ARRAY

[line 74]



Tags:

var:  The type of storage (class or array)
access:  private

Type:   int


[ Top ]

$_wordArray = array()

[line 49]



Tags:

var:  The word array to analyze.
access:  private

Type:   array


[ Top ]

$_wordArrayData = array()

[line 59]



Tags:

var:  Contains an array with data about the words.
access:  private

Type:   array


[ Top ]

$_wordContainers = array()

[line 54]



Tags:

var:  Container classes
access:  private

Type:   array


[ Top ]



Class Methods


constructor __construct [line 79]

Mai_Analyzer_Words __construct( $creator, [ $type = Mai::STORAGE_TYPE_ARRAY])

Check if Mai has been setup and that the creator is Mai_Analyzer.



Tags:

access:  public


Parameters:

   $creator  
   $type  

[ Top ]

method addSource [line 213]

void addSource( string $name, $data)

Add a word source to the analyzer.



Tags:

access:  public



Implementation of:
Mai_Analyzer_Interface::addSource()

Parameters:

string   $name  
array   $data  

[ Top ]

method removeSource [line 245]

void removeSource( string $name)

Remove source.



Tags:

access:  public



Implementation of:
Mai_Analyzer_Interface::removeSource()

Parameters:

string   $name  

[ Top ]

method returnWordData [line 262]

array returnWordData( )

Return data from the analyzed words.

This class also uses references, using this function is not required.




Tags:

access:  public


[ Top ]

method run [line 100]

void run( )

Analyze the word array (or containers) and save locally.



Tags:

access:  public



Implementation of:
Mai_Analyzer_Interface::run()
[ Top ]

method set [line 192]

void set( $data, int $type)

Set the word array to analyze. This function uses references.

Original data will be changed by this analyzer.




Tags:

access:  public



Implementation of:
Mai_Analyzer_Interface::set()

Parameters:

int   $type  
array   $data  

[ Top ]


Documentation generated on Mon, 27 Jul 2009 19:55:15 +0200 by phpDocumentor 1.4.1