edu.stanford.nlp.ie.pascal
Class PascalTemplate

java.lang.Object
  extended by edu.stanford.nlp.ie.pascal.PascalTemplate

public class PascalTemplate
extends Object

Maps non-background Pascal fields to strings.

Author:
Chris Cox

Field Summary
static String BACKGROUND_SYMBOL
           
static String[] fields
           
 
Constructor Summary
PascalTemplate()
           
PascalTemplate(PascalTemplate pt)
           
 
Method Summary
static boolean acronymMatch(String s1, String s2, HashMap stemmedAcronymIndex)
           
 boolean equals(Object obj)
           
static int getFieldIndex(String tag)
           
 String getValue(String fieldName)
           
 int hashCode()
           
static PascalTemplate mergeCliqueTemplates(DateTemplate dt, String location, InfoTemplate wi)
          Merges partial (clique) templates into a full one.
 void print()
           
 void setValue(int index, String value)
           
 void setValue(String fieldName, String value)
          Sets template values.
static String stemAcronym(String s, CliqueTemplates ct)
           
 String toString()
           
 void unpackToCliqueTemplates(CliqueTemplates ct, double score)
          Divides this template into partial templates, and updates the counts of these partial templates in the CliqueTemplates object.
 void writeToFieldValueCounter(ClassicCounter[] fieldValueCounter, double score)
          Should be passed a Counter[], each entry of which keeps scores for possibilities in that template slot.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

fields

public static final String[] fields

BACKGROUND_SYMBOL

public static final String BACKGROUND_SYMBOL
See Also:
Constant Field Values
Constructor Detail

PascalTemplate

public PascalTemplate()

PascalTemplate

public PascalTemplate(PascalTemplate pt)
Method Detail

acronymMatch

public static boolean acronymMatch(String s1,
                                   String s2,
                                   HashMap stemmedAcronymIndex)
Parameters:
s1 -
s2 -
stemmedAcronymIndex -
Returns:

stemAcronym

public static String stemAcronym(String s,
                                 CliqueTemplates ct)
Parameters:
s -
ct -
Returns:

mergeCliqueTemplates

public static PascalTemplate mergeCliqueTemplates(DateTemplate dt,
                                                  String location,
                                                  InfoTemplate wi)
Merges partial (clique) templates into a full one.

Parameters:
dt - date template
location - location
wi - workshop/conference info template
Returns:
the PascalTemplate resulting from this merge.

setValue

public void setValue(String fieldName,
                     String value)
Sets template values.

Parameters:
fieldName - (i.e. workshopname, workshopdate)
value -

setValue

public void setValue(int index,
                     String value)

getValue

public String getValue(String fieldName)

equals

public boolean equals(Object obj)
Overrides:
equals in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object

getFieldIndex

public static int getFieldIndex(String tag)
Parameters:
tag - field name (i.e. workshopdate, workshoplocation)
Returns:
the reference of that field in the underlying Index

writeToFieldValueCounter

public void writeToFieldValueCounter(ClassicCounter[] fieldValueCounter,
                                     double score)
Should be passed a Counter[], each entry of which keeps scores for possibilities in that template slot. The counter for each template value is incremented by the corresponding score of this PascalTemplate.

Parameters:
fieldValueCounter - an array of counters, each of which holds label possibilities for one field
score - increment counts by this much.

unpackToCliqueTemplates

public void unpackToCliqueTemplates(CliqueTemplates ct,
                                    double score)
Divides this template into partial templates, and updates the counts of these partial templates in the CliqueTemplates object.

Parameters:
ct - the partial templates counter object
score - increment counts by this much

print

public void print()

toString

public String toString()
Overrides:
toString in class Object


Stanford NLP Group