org.alicebot.server.core.parser
Class DeprecatedAIMLParser

java.lang.Object
  extended by org.alicebot.server.core.parser.DeprecatedAIMLParser

public class DeprecatedAIMLParser
extends java.lang.Object

Processes deprecated AIML tags. Uses the old "giant conditional tree" approach, so it's slower and not preferable.

Since:
4.1.3
Author:
Pedro Colla (moved here by Noel Bush)

Field Summary
static java.lang.String ALICE
          The string "alice".
static java.lang.String BEFORETHAT
          The string "beforethat".
static java.lang.String BIRTHDAY
          The string "birthday".
static java.lang.String BIRTHPLACE
          The string "birthplace".
static java.lang.String BOTMASTER
          The string "botmaster".
static java.lang.String BOYFRIEND
          The string "boyfriend".
static java.lang.String FAVORITEBAND
          The string "favoriteband".
static java.lang.String FAVORITEBOOK
          The string "favoritebook".
static java.lang.String FAVORITECOLOR
          The string "favoritecolor".
static java.lang.String FAVORITEFOOD
          The string "favoritefood".
static java.lang.String FAVORITEMOVIE
          The string "favoritemovie".
static java.lang.String FAVORITESONG
          The string "favoritesong".
static java.lang.String FOR_FUN
          The string "for_fun".
static java.lang.String FRIENDS
          The string "friends".
static java.lang.String GENDER
          The string "gender".
static java.lang.String GET_IP
          The string "get_ip".
static java.lang.String GET_OLD
          The string "get_".
static java.lang.String GETNAME
          The string "getname".
static java.lang.String GETSIZE
          The string "getsize".
static java.lang.String GETTOPIC
          The string "gettopic".
static java.lang.String GETVERSION
          The string "getversion".
static java.lang.String GIRLFRIEND
          The string "girlfriend".
static java.lang.String JUSTBEFORETHAT
          The string "justbeforethat".
static java.lang.String JUSTTHAT
          The string "justthat".
static java.lang.String KIND_MUSIC
          The string "kind_music".
static java.lang.String LOAD
          The string "load".
static java.lang.String LOCATION
          The string "location".
static java.lang.String LOOK_LIKE
          The string "look_like".
static java.lang.String NAME
          The string "name".
static java.lang.String QUESTION
          The string "question".
static java.lang.String QUOTE_MARK
          A quote mark, for convenience.
static java.lang.String SET_OLD
          The string "set_".
static java.lang.String SETNAME
          The string "setname".
static java.lang.String SETTOPIC
          The string "settopic".
static java.lang.String SIGN
          The string "sign".
static java.lang.String TALK_ABOUT
          The string "talk_about".
static java.lang.String WEAR
          The string "wear".
 
Constructor Summary
DeprecatedAIMLParser()
           
 
Method Summary
static java.lang.String processTag(int level, java.lang.String userid, XMLNode tag, TemplateParser parser)
           Recursively processes purportedly deprecated AIML tags, with top-down, inside-out order.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

QUOTE_MARK

public static final java.lang.String QUOTE_MARK
A quote mark, for convenience.

See Also:
Constant Field Values

ALICE

public static final java.lang.String ALICE
The string "alice".

See Also:
Constant Field Values

NAME

public static final java.lang.String NAME
The string "name".

See Also:
Constant Field Values

JUSTBEFORETHAT

public static final java.lang.String JUSTBEFORETHAT
The string "justbeforethat".

See Also:
Constant Field Values

JUSTTHAT

public static final java.lang.String JUSTTHAT
The string "justthat".

See Also:
Constant Field Values

BEFORETHAT

public static final java.lang.String BEFORETHAT
The string "beforethat".

See Also:
Constant Field Values

GET_OLD

public static final java.lang.String GET_OLD
The string "get_".

See Also:
Constant Field Values

GET_IP

public static final java.lang.String GET_IP
The string "get_ip".

See Also:
Constant Field Values

GETNAME

public static final java.lang.String GETNAME
The string "getname".

See Also:
Constant Field Values

GETSIZE

public static final java.lang.String GETSIZE
The string "getsize".

See Also:
Constant Field Values

GETTOPIC

public static final java.lang.String GETTOPIC
The string "gettopic".

See Also:
Constant Field Values

GETVERSION

public static final java.lang.String GETVERSION
The string "getversion".

See Also:
Constant Field Values

LOAD

public static final java.lang.String LOAD
The string "load".

See Also:
Constant Field Values

SETTOPIC

public static final java.lang.String SETTOPIC
The string "settopic".

See Also:
Constant Field Values

SETNAME

public static final java.lang.String SETNAME
The string "setname".

See Also:
Constant Field Values

SET_OLD

public static final java.lang.String SET_OLD
The string "set_".

See Also:
Constant Field Values

BIRTHDAY

public static final java.lang.String BIRTHDAY
The string "birthday".

See Also:
Constant Field Values

BIRTHPLACE

public static final java.lang.String BIRTHPLACE
The string "birthplace".

See Also:
Constant Field Values

BOYFRIEND

public static final java.lang.String BOYFRIEND
The string "boyfriend".

See Also:
Constant Field Values

FAVORITEBAND

public static final java.lang.String FAVORITEBAND
The string "favoriteband".

See Also:
Constant Field Values

FAVORITEBOOK

public static final java.lang.String FAVORITEBOOK
The string "favoritebook".

See Also:
Constant Field Values

FAVORITECOLOR

public static final java.lang.String FAVORITECOLOR
The string "favoritecolor".

See Also:
Constant Field Values

FAVORITEFOOD

public static final java.lang.String FAVORITEFOOD
The string "favoritefood".

See Also:
Constant Field Values

FAVORITEMOVIE

public static final java.lang.String FAVORITEMOVIE
The string "favoritemovie".

See Also:
Constant Field Values

FAVORITESONG

public static final java.lang.String FAVORITESONG
The string "favoritesong".

See Also:
Constant Field Values

FOR_FUN

public static final java.lang.String FOR_FUN
The string "for_fun".

See Also:
Constant Field Values

FRIENDS

public static final java.lang.String FRIENDS
The string "friends".

See Also:
Constant Field Values

GENDER

public static final java.lang.String GENDER
The string "gender".

See Also:
Constant Field Values

GIRLFRIEND

public static final java.lang.String GIRLFRIEND
The string "girlfriend".

See Also:
Constant Field Values

KIND_MUSIC

public static final java.lang.String KIND_MUSIC
The string "kind_music".

See Also:
Constant Field Values

LOCATION

public static final java.lang.String LOCATION
The string "location".

See Also:
Constant Field Values

LOOK_LIKE

public static final java.lang.String LOOK_LIKE
The string "look_like".

See Also:
Constant Field Values

BOTMASTER

public static final java.lang.String BOTMASTER
The string "botmaster".

See Also:
Constant Field Values

QUESTION

public static final java.lang.String QUESTION
The string "question".

See Also:
Constant Field Values

SIGN

public static final java.lang.String SIGN
The string "sign".

See Also:
Constant Field Values

TALK_ABOUT

public static final java.lang.String TALK_ABOUT
The string "talk_about".

See Also:
Constant Field Values

WEAR

public static final java.lang.String WEAR
The string "wear".

See Also:
Constant Field Values
Constructor Detail

DeprecatedAIMLParser

public DeprecatedAIMLParser()
Method Detail

processTag

public static java.lang.String processTag(int level,
                                          java.lang.String userid,
                                          XMLNode tag,
                                          TemplateParser parser)
                                   throws UnknownDeprecatedAIMLException

Recursively processes purportedly deprecated AIML tags, with top-down, inside-out order.

Uses the inefficient method of the old TemplateParser, so shouldn't be used if one can help it.

The actual tag to process is driven by @{link TemplateParser#evaluate}, so strict sequencing is used. For each valid tag, the associated AIMLProcessor, resolution code or #shortcutTag processor is activated.

If no tag is recognized, an UnknownDeprecatedAIMLTagException is thrown.

Tags are explored sequentially. The sequence has performance implications (frequently-used tags should be first). However, the actual sequence within the template is preserved, because it's driven by the caller method (usually #evaluate) and not by the order in which the tags are resolved.

Parameters:
level - the current level in the XML trie
userid - the user identifier
tag - the tag being evaluated
parser - the TemplateParser that called this
Returns:
the result of processing the tag
Throws:
UnknownDeprecatedAIMLException - if no tags are recognized