vn
Class Matcher

java.lang.Object
  extended by vn.Matcher

public class Matcher
extends Object

This class contains all the match constraints materalized into code. All methods besides those for the null constraint and the naive constraint accept a VerbNet syntax string and a Cyc verbSemTrans rule as their arugments. These methods don't need to know what the verb is because it is assumed when they are called, the naive constraint has already been applied, and the VerbNet syntax and Cyc rule arguments are for the same verb. The naive constraint will always be applied first. If the naive constraint for a VN syntax-Cyc rule pair fails (i.e. the syntax was for verb 'jump' and Cyc rule was for verb 'jest') then there is no match and no further constrains are applied.

Each method returns a boolean value. If a constraint method returns false, that method has determined that the VerbNet syntax and the Cyc rule are incompatible and there is no match. However, if a constraint method returns true, it is not saying that there exists a good match, but rather that there is no reason to discard the match as far as it is concerned. There could exist other constraint methods that find cause to discard it.

The word match means that a congruence was found between a VerbNet verb-frame pair and a Cyc rule. The defend-85 VerbNet class has 4 members and 4 frames (as of VN Version 2.1). Therefore, there are 16 verb-frame pairs for this class. Each verb-frame pair has the possibility of matching with one or more Cyc verbSemTrans rules. Each Cyc rule is basically a syntactic frame for a single verb. A possible match is any such (verb-frame pair, Cyc rule) combination. The constraints applied by VxC (as specified by -A operator) determine if there exists an actual match.

The methods bad_DBPBimpliesCause(String, String, String) and bad_agentImpliesDBPB(String, String) are only included in this Javadoc for historical and informational purposes. They represent constraints that had poor performance on the VerbNet-Cyc mapping. They are not available for use when executing the VxC application (i.e. they are not invoked when the -Aa option is provided).

Finally, usually the implementation of these methods can be understood by examining the syntax of the VerbNet syntax statement and the tokens that are generally used in Cyc rules. Use the key option (-k) to learn more about VerbNet syntax:

   java vn.Inspector -k
Also, one can get a good feel for VerbNet syntax by just looking at lots of examples. If you download the original Inspector (instead of trying to use VxC as a VerbNet viewer) you can quickly pull all the VerbNet syntax strings:
   java vn.Inspector xml/ -Vxyz
You can use VxC as a VerbNet viewer, you just have to still specify all the mandatory operators (-C, -M and -F).

NOTE: The VerbNet and Cyc data is given to these methods in the case that it was in when it was extracted from the external files. In other words, all token matches in either the VerbNet or Cyc data must be done in a case-sensitive manner. Luckily the case format for both systems is standardized so you need not worry about performing case-insensitive comparisons.

Version:
1.0, 2006.10.25
Author:
Derek Trumbo
See Also:
Cyc.findCycMatches(String, String, String, int, String)

Constructor Summary
private Matcher()
          This constructor is private because the class is not intended to ever be instantiated.
 
Method Summary
(package private) static boolean adjective(String vnSyntax, String cycRule)
          Signals to discard a possible match if the adjectives in both the VerbNet syntax and the Cyc rule do not correspond.
(package private) static boolean bad_agentImpliesDBPB(String vnSyntax, String cycRule)
          Signals to discard a possible match if the VerbNet syntax specifies 'Agent' as the noun phrase that immediately precedes the verb and the Cyc rule does not have the predicates 'doneBy' or 'performedBy' for the subject of the verb.
(package private) static boolean bad_DBPBimpliesCause(String vnSyntax, String vnSem, String cycRule)
          Signals to discard a possible match if the Cyc rule specifies the predicates 'doneBy' or 'performedBy' for the subject and VerbNet does not have 'cause(Agent' appearing somewhere in the semantics for the verb-frame pair.
(package private) static boolean cycPreposition(String vnSyntax, String cycRule)
          Signals to discard a possible match if the prepositions in both the VerbNet syntax and the Cyc rule do not correspond.
(package private) static boolean DBPBimpliesAgent(String vnSyntax, String cycRule)
          Signals to discard a possible match if the Cyc rule specifies the predicates 'doneBy' or 'performedBy' for the subject and VerbNet does not have 'Agent' for the noun phrase immediately preceding the Verb.
private static void eprint(String s)
          Used as shorthand for System.err.print.
private static void eprintln(String s)
          Used as shorthand for System.err.println.
(package private) static boolean fromLocationImpliesSource(String vnSyntax, String cycRule)
          Signals to discard a possible match if the Cyc rule specifies the predicate 'fromLocation' for the direct object and VerbNet does not have 'Source' for the noun phrase immediately following the Verb.
(package private) static boolean infinitiveGerund(String vnSyntax, String cycRule)
          Signals to discard a possible match if the infinitive or gerund nature in both the VerbNet syntax and the Cyc rule do not correspond.
(package private) static boolean middleVoiceNoAgent(String vnSyntax, String cycRule)
          Signals to discard a possible match if the Cyc rule is of type MiddleVoiceFrame and VerbNet specifies 'Agent' for the noun phrase immediately preceding the verb.
(package private) static boolean naive(String vnVerb, String cycVerb)
          Signals to discard a possible match between a VN frame's syntax and a Cyc rule if the verbs (lemmas) are unequal.
(package private) static boolean nullMatch()
          Always returns false.
(package private) static boolean transitivity(String vnSyntax, String cycRule)
          Signals to discard a possible match if the transitivity in both the VerbNet syntax and the Cyc rule do not correspond.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Matcher

private Matcher()
This constructor is private because the class is not intended to ever be instantiated. The Inspector's job is very procedural and thus all its members are static.

Method Detail

eprintln

private static void eprintln(String s)
Used as shorthand for System.err.println.

Parameters:
s - the string to print
See Also:
PrintStream.println(String)

eprint

private static void eprint(String s)
Used as shorthand for System.err.print.

Parameters:
s - the string to print
See Also:
PrintStream.print(String)

nullMatch

static boolean nullMatch()
Always returns false. It discards every possible match. This method is for debugging purposes only, but can still be invoked on the command-line. Its constraint symbol is 0 (zero). Using this constraint (-A0 on command-line), one should expect to find the following results produced (assuming there are X total manual mapping matches and Y naive matches discarded by the manual mapping process): If these are not the results produced then there is an error either somewhere within the code or with the manual mapping file. For version 1.0 of VxC, X is 139 and Y is 264.

Returns:
false
See Also:
Cyc.findCycMatches(String, String, String, int, String)

naive

static boolean naive(String vnVerb,
                     String cycVerb)
Signals to discard a possible match between a VN frame's syntax and a Cyc rule if the verbs (lemmas) are unequal. Its constraint symbol is n. This is a special constraint because it must always be applied before the other constraints (besides the null constraint). It makes no sense to compare the syntax for the verb 'jump' in a verb-frame pair and a Cyc rule for the verb 'jest'. Using this constraint alone can also be used for debugging purposes. Using this constraint (-An on command-line), one should expect to find the following results produced (assuming there are X total manual mapping matches and Y naive matches discarded by the manual mapping process): If these are not the results produced then there is an error either somewhere within the code or with the manual mapping file. For version 1.0 of VxC, X is 139 and Y is 264.

Parameters:
vnVerb - the verb from the verb-frame pair
cycVerb - the verb from the Cyc rule
Returns:
true if the lemma for the verb-frame pair matches the lemma in the Cyc rule, false otherwise
See Also:
Cyc.findCycMatches(String, String, String, int, String)

cycPreposition

static boolean cycPreposition(String vnSyntax,
                              String cycRule)
Signals to discard a possible match if the prepositions in both the VerbNet syntax and the Cyc rule do not correspond. Its constraint symbol is p. If the Cyc rule requires a specific preposition but the VerbNet frame syntax either does not specify a verb at all after the verb, or it does specify one or more prepositions but the prepositions that follow the verb do not include the preposition in the Cyc rule, then the possible match is invalid. If the Cyc rule does not require a preposition then true is returned.

Parameters:
vnSyntax - the syntax from the verb-frame pair for this possible match
cycRule - the Cyc rule for this possible match
Returns:
false if this possible match does not meet the constraint, true if it does meet the constraint or the constraint does not apply to the given possible match
See Also:
Cyc.findCycMatches(String, String, String, int, String), Cyc.cycHasPreposition(String), Cyc.cycExtractPreposition(String), PrepositionManager.prepInClass(String, String)

transitivity

static boolean transitivity(String vnSyntax,
                            String cycRule)
Signals to discard a possible match if the transitivity in both the VerbNet syntax and the Cyc rule do not correspond. Its constraint symbol is t. One of the arguments for the verbSemTrans predicate is a frame type which describes the transitivity. In the VerbNet syntax, if there is a % sign following the verb (i.e. a noun phrase) then the frame is assumed to be transitive.

Parameters:
vnSyntax - the syntax from the verb-frame pair for this possible match
cycRule - the Cyc rule for this possible match
Returns:
false if this possible match does not meet the constraint, true if it does meet the constraint or the constraint does not apply to the given possible match
See Also:
Cyc.findCycMatches(String, String, String, int, String), Cyc.cycExtractTrans(String)

infinitiveGerund

static boolean infinitiveGerund(String vnSyntax,
                                String cycRule)
Signals to discard a possible match if the infinitive or gerund nature in both the VerbNet syntax and the Cyc rule do not correspond. Its constraint symbol is i. This constraint only operates on cases where either the VerbNet syntax or the Cyc rule involves an infinitive or gerund (i.e. "He continued painting"). If neither involves an infinitive or gerund, then true is returned. If one of them involves an infinitive, then the other must as well. If one of them involves a gerund, then the other must as well.

Parameters:
vnSyntax - the syntax from the verb-frame pair for this possible match
cycRule - the Cyc rule for this possible match
Returns:
false if this possible match does not meet the constraint, true if it does meet the constraint or the constraint does not apply to the given possible match
See Also:
Cyc.findCycMatches(String, String, String, int, String)

adjective

static boolean adjective(String vnSyntax,
                         String cycRule)
Signals to discard a possible match if the adjectives in both the VerbNet syntax and the Cyc rule do not correspond. Its constraint symbol is j. The VerbNet syntax and the Cyc rule have to either both involve an adjective construction or both not involve an adjective construction.

Parameters:
vnSyntax - the syntax from the verb-frame pair for this possible match
cycRule - the Cyc rule for this possible match
Returns:
false if this possible match does not meet the constraint, true if it does meet the constraint or the constraint does not apply to the given possible match
See Also:
Cyc.findCycMatches(String, String, String, int, String)

fromLocationImpliesSource

static boolean fromLocationImpliesSource(String vnSyntax,
                                         String cycRule)
Signals to discard a possible match if the Cyc rule specifies the predicate 'fromLocation' for the direct object and VerbNet does not have 'Source' for the noun phrase immediately following the Verb. Its constraint symbol is f.

Parameters:
vnSyntax - the syntax from the verb-frame pair for this possible match
cycRule - the Cyc rule for this possible match
Returns:
false if this possible match does not meet the constraint, true if it does meet the constraint or the constraint does not apply to the given possible match
See Also:
Cyc.findCycMatches(String, String, String, int, String)

DBPBimpliesAgent

static boolean DBPBimpliesAgent(String vnSyntax,
                                String cycRule)
Signals to discard a possible match if the Cyc rule specifies the predicates 'doneBy' or 'performedBy' for the subject and VerbNet does not have 'Agent' for the noun phrase immediately preceding the Verb. Its constraint symbol is d.

Parameters:
vnSyntax - the syntax from the verb-frame pair for this possible match
cycRule - the Cyc rule for this possible match
Returns:
false if this possible match does not meet the constraint, true if it does meet the constraint or the constraint does not apply to the given possible match
See Also:
Cyc.findCycMatches(String, String, String, int, String)

middleVoiceNoAgent

static boolean middleVoiceNoAgent(String vnSyntax,
                                  String cycRule)
Signals to discard a possible match if the Cyc rule is of type MiddleVoiceFrame and VerbNet specifies 'Agent' for the noun phrase immediately preceding the verb. With middle voice, there should not be an 'Agent' as the subject of the verb, only 'Theme', 'Experiencer', etc. Its constraint symbol is m.

Parameters:
vnSyntax - the syntax from the verb-frame pair for this possible match
cycRule - the Cyc rule for this possible match
Returns:
false if this possible match does not meet the constraint, true if it does meet the constraint or the constraint does not apply to the given possible match
See Also:
Cyc.findCycMatches(String, String, String, int, String)

bad_DBPBimpliesCause

static boolean bad_DBPBimpliesCause(String vnSyntax,
                                    String vnSem,
                                    String cycRule)
Signals to discard a possible match if the Cyc rule specifies the predicates 'doneBy' or 'performedBy' for the subject and VerbNet does not have 'cause(Agent' appearing somewhere in the semantics for the verb-frame pair. Its constraint symbol is c. NOTE: Although this method is made visible in the Javadoc documentation - it is NOT activated. Its constraint symbol is not valid and it is not included when -Aa is provided. It produced less than desirable results when applied to the possible matches.

Parameters:
vnSyntax - the syntax from the verb-frame pair for this possible match
vnSem - the semantics from the verb-frame pair for this possible match in one continuous string.
cycRule - the Cyc rule for this possible match
Returns:
false if this possible match does not meet the constraint, true if it does meet the constraint or the constraint does not apply to the given possible match
See Also:
Cyc.findCycMatches(String, String, String, int, String)

bad_agentImpliesDBPB

static boolean bad_agentImpliesDBPB(String vnSyntax,
                                    String cycRule)
Signals to discard a possible match if the VerbNet syntax specifies 'Agent' as the noun phrase that immediately precedes the verb and the Cyc rule does not have the predicates 'doneBy' or 'performedBy' for the subject of the verb. Its constraint symbol is e. NOTE: Although this method is made visible in the Javadoc documentation - it is NOT activated. Its constraint symbol is not valid and it is not included when -Aa is provided. It produced less than desirable results when applied to the possible matches.

Parameters:
vnSyntax - the syntax from the verb-frame pair for this possible match
cycRule - the Cyc rule for this possible match
Returns:
false if this possible match does not meet the constraint, true if it does meet the constraint or the constraint does not apply to the given possible match
See Also:
Cyc.findCycMatches(String, String, String, int, String)