2
* @file EnglishParser.cpp
3
* @author Jacky Alcine <jackyalcine@gmail.com>
4
* @created February 10, 2011, 12:07 AM
7
* This library is free software; you can redistribute it and/or
8
* modify it under the terms of the GNU Library General Public
9
* License as published by the Free Software Foundation; either
10
* version 3 of the License, or (at your option) any later version.
12
* This library is distributed in the hope that it will be useful,
13
* but WITHOUT ANY WARRANTY; without even the implied warranty of
14
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15
* Library General Public License for more details.
17
* You should have received a copy of the GNU Library General Public
18
* License along with this library; if not, write to the
19
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
20
* Boston, MA 02111-1307, USA.
24
#ifndef WINTERMUTE_LINGUISTICS_ENGLISHPARSER_HPP
25
# define WINTERMUTE_LINGUISTICS_ENGLISHPARSER_HPP
27
# include <wintermute-linguistics.hpp>
30
namespace Wintermute {
31
namespace Linguistics {
33
using namespace Wintermute::Linguistics;
36
* @description Represents a parser that understands a set of English syntax,
38
class EnglishParser : public Parser {
41
* @description Creates a new English parser.
45
* @description Returns the locale of this parser.
46
* @return string The locale of the parser; defaults to 'en'.
48
virtual const string getLocale ( ) const;
51
* @note This will always return a space.
52
* @description Determines the separator used to represent a break between words.
53
* @return char A character representing a space.
55
virtual char getTextSeparator ( ) const;
59
* @description Generates the preliminary information of the syntactical tree to be formed from a set of tokens.
60
* @param StringVector The tokens to parse.
61
* @return SyntacticBranch The tree of nodes representing every possible path of interpretation for this node.
63
virtual SyntacticBranch generateSyntactics ( const StringVector& );
65
* @description Generates a Phrase from a said node at a specific position in a sentence.
66
* @param NodeVector::iterator The position of the node to be the 'head' node of the phrase.
67
* @param NodeVector The entire vector of nodes.
68
* @return A pointer to the Phrase formed, or NULL.
70
virtual Phrase* formPhrase ( const NodeVector::iterator& , NodeVector& );
72
* @description Generates a SyntacticLink from a phrase to another phrase.
73
* @param PhraseVector::iterator The position of the phrase to be considered.
74
* @param PhraseVector The entire vector of phrases.
75
* @return A pointer to the Link formed, or NULL.
77
virtual SyntacticLink* formSyntacticLink ( const PhraseVector::iterator& , PhraseVector& );
79
* @note This function does nothing at the moment, only will come to use as the ontology grows.
80
* @description Does prerequeiste work on each node; such as connecting them to concepts or instances within the ontology; a sort of 'late binding'.
81
* @param The PhraseVector to iterate over and connect.
83
virtual void doPreparsingWork ( PhraseVector& );
85
* @note This is the most interestingly complex method of them all.
86
* @descripion Interprets and, if needed, carries out the tasks described by a sentence.
87
* @param The LinkVector to iterate over and interpret.
89
virtual void interpretLinks ( const LinkVector& );
95
#endif /* WINTERMUTE_LINGUISTICS_ENGLISHPARSER_HPP */