ca.uottawa.balie
Class NamedEntityAlias

java.lang.Object
  extended by ca.uottawa.balie.NamedEntityAlias

public class NamedEntityAlias
extends java.lang.Object

NE alias object is a set of labels that represent the same entity

Author:
nadeaud

Constructor Summary
NamedEntityAlias(java.util.ArrayList<java.lang.String> pi_alBow, int pi_EntityIndex, int pi_NETagSetSize)
          A concept (alias) that represents one or many named entity
 
Method Summary
 void Add(java.util.ArrayList<java.lang.String> pi_alBow, int pi_Index)
          Add an entity bag-of-word to this alias
 java.util.ArrayList<java.lang.String> Bow()
          Get entire BOW for this alias
 NamedEntityType DominantType()
           
 java.util.ArrayList<java.lang.Integer> Entities()
          Get list of indexes of entities
 void Merge(NamedEntityAlias pi_Alias)
          Merge aliases
 void SetDominantType(NamedEntityType pi_NE)
          Set the dominant type for this entity the dominant type is the preferred type to be applied to all elements of the alias
 boolean SignificantOverlap(java.util.ArrayList<java.lang.String> pi_Bow)
          Check if this alias and a bag-of-word have a significant overlap (at least half of words overlap)
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

NamedEntityAlias

public NamedEntityAlias(java.util.ArrayList<java.lang.String> pi_alBow,
                        int pi_EntityIndex,
                        int pi_NETagSetSize)
A concept (alias) that represents one or many named entity

Parameters:
pi_alBow - words that belongs to this alias
pi_EntityIndex - index of an entity (at least this entity is required to create an alias)
Method Detail

Add

public void Add(java.util.ArrayList<java.lang.String> pi_alBow,
                int pi_Index)
Add an entity bag-of-word to this alias

Parameters:
pi_alBow - Words of this entity
pi_Index - index of this entity

Merge

public void Merge(NamedEntityAlias pi_Alias)
Merge aliases

Parameters:
pi_Alias - alias to mege with

SignificantOverlap

public boolean SignificantOverlap(java.util.ArrayList<java.lang.String> pi_Bow)
Check if this alias and a bag-of-word have a significant overlap (at least half of words overlap)

Parameters:
pi_Bow - bow to check
Returns:
true if overlap

Entities

public java.util.ArrayList<java.lang.Integer> Entities()
Get list of indexes of entities

Returns:
list of indexes

Bow

public java.util.ArrayList<java.lang.String> Bow()
Get entire BOW for this alias

Returns:
the union of all BOW of all entities of this alias

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

SetDominantType

public void SetDominantType(NamedEntityType pi_NE)
Set the dominant type for this entity the dominant type is the preferred type to be applied to all elements of the alias

Parameters:
pi_NE - a type (must contains ionly one primitive type)

DominantType

public NamedEntityType DominantType()
Returns:
the dominant type