Harvey::Verb - Harvey module for parsing verbs.


  use Harvey::Verb;

  The is still very much a development module.  See the website: for more details on the project. builds on top of, which provides the Word objects which
  are used by

  See for information on using to obtain information about
  Word objects.  Verb objects are created by passing an array of Word objects
  (A) which constitute a sentence, as an argument to the Verb object
  constructor.  $V = Verb->new(\@A);

  The Verb object parses the verb in the sentence upon initialization to the
  best apparent parsing.  The Verb object can then be queried for information
  about the verb object using the following methods.

  See the Harvey module for a simple dialog routine that uses the Verb module
  to parse sentences and pull the verb information from them.


  The following methods constitute the interface to this object:

    Constructor.  Send in an array reference to a block of word objects 
    ( to have the verb information parsed and made available.  If
    no argument is passed in, then a blank verb is set up which can be
    manually stuffed with information.

    Method to load or retrieve word arrays from the object.  If a word array
    is loaded manually after the initialization of the object, then the 
    parsing must be performed by a call to parse() or best().

    Returns an integer with bits set indicating which words in the array
    are used in the verb complex.  This will be used to match verbs against
    nouns in a sentence when the noun module comes out.

    Calculates the best parsing of the sentence based on how many word are
    involved in the parsing and whether they are started off by the most
    common verb starters.

    Returns a string rendition of the tense of the verb in the word array.

    Returns the adverbs in the verb complex as strings for show.

    Returns the Int which stores the tenses, and/or, sets the tenses if an
    Int is sent in.  Used mainly to set up modal verb objects from scratch.

    Get/Set present tense.  Input of 1 or 0 sets or clears the present 
    tense.  All calls return the final status of the present tense flag.

    Get/set past tense as above.

    Get/set perfect tense as above.

    Get/set progressive tense as above.

    Get/set infinitive flag as above.

    Get/set the persons information.  The persons information is stored
    in an integer with a flag for the 1st pers sing, 2nd sing. 3rd sing,
    etc.  Send in an integer to set it.  The current values is alwasys
    returned.  Verbs, Noun object (when they come out) both indicate what
    possible persons they would support.  This allows for convient checking
    of subject verb agreement.

    Gets/set the infinitive of the main verb as a string

    Get/sets the array of adverbs found in the sentence.  Arguments are 
    passed in and out as a reference to an array.

    Get/sets the sentence type.  Arg in and out is an integer.  
    0 = statement, 1 = question, 2 = command.

    Get/set whether the sentence is a statement.

    Get/set whether the sentence is a question.

    Get/set whether the sentence is a command.

    Finds the best parsing based on the number of words (more is better) 
    in the verb structure and obviousness of the leadoff verb. 

    Performs the parsing of the object.  Takes three possible integer
    arguments (0|1|2).  0: always start parsing on exact matches to 
    helping verbs or modals; 1: always start parsing on verbs the are
    most frequently used as verbs; 2: allow any potential verb to start
    the parsing.  0 is default


None by default.


Chris Meyer<lt><gt>


  Copywrite (c) 2002, Chris Meyer.  All rights reserved.  This is 
  free software and can be used under the same terms as Perl itself.




  My heartfelt thanks to Adam Kilgarriff for his work on the BNC 
  (British National Corpus) which forms the basis for the word.db.
  I have added and massaged it a bit, but I would never have gotten
  this far without it.  The BNC can be visited at


  Harvey uses algorithms AND data to work.  The program looks for 
  a file called 'system.dat' in the startup directory.  In this file
  it looks for a line that reads 'path=your_path', where your_path
  is the directory where the data resides.  


  The accompanying Harvey module comes with a simple dialog routine 
  that uses to demonstrate the parsing of sentence.