edu.stanford.nlp.ie.pcfg
Class Pattern

java.lang.Object
  |
  +--edu.stanford.nlp.ie.pcfg.Pattern

public class Pattern
extends Object

Utility class for IEParser. Includes a useful heuristic for cutting down the IEParser search space (i.e., speeding up the IE task by speeding up IEParser.Parse


Field Summary
static List hint
          The IEMan sets the hint to give Pattern a better idea what sort of tag assignments are/aren't allowed for this sentence.
 
Constructor Summary
Pattern()
           
 
Method Summary
static List GetOKPatterns(List list, int size)
          Returns a subset of GetPatterns, following suggestions from "hint".
static List GetPatterns(List list, int size)
          Gets all the possible way that the tags in "list" can be distributed across "size" elements.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

hint

public static List hint
The IEMan sets the hint to give Pattern a better idea what sort of tag assignments are/aren't allowed for this sentence. After the IEMan sets the hint, the hint contains one list for each word in the sentence currently being examined by the IEMan. Each list contains all of the tags that the IEMan expects might be associated with the corresponding word. For example, if the second word in the sentence is a NNP, and the IEMan expects that an NNP can be a "purchaser" or an "acquired" but not a "dlramt", the second list in hint would be {"purchaser", "acquired", null} (where "null" represents the fact that the NNP can also take NO tag).

Constructor Detail

Pattern

public Pattern()
Method Detail

GetPatterns

public static List GetPatterns(List list,
                               int size)
Gets all the possible way that the tags in "list" can be distributed across "size" elements. Not all of the "size" elements must be assigned a tag (in which case they get assigned null). However, each tag in the list can only get assigned to adjacent spots (of course, if the list contains two identical tags, then there could be a gap between these tags. e.g., GetPatterns({"A"}, 3) could not return ["A", null, "A"] but GetPatterns({"A", "A"}, 3) could.


GetOKPatterns

public static List GetOKPatterns(List list,
                                 int size)
Returns a subset of GetPatterns, following suggestions from "hint". As mentioned above, "hint" contains lists of all the tags that can be assigned to each spot. e.g., a sentence with length 3 might have the following hint: [["purchaser", null],[null],"purchaser",null]]. GetPatterns might return some tag patterns that do not correspond to suggestions made by the hint, e.g., ["purchaser","purchaser","purchaser"] might be returned by GetPatterns but would not be allowed by the hint because the hint says that no tag (other than "null") can be assigned to the second word. So, GetOKPatterns filters the set returned by GetPatterns



Stanford NLP Group