Package relations
Class BasicChunk
- java.lang.Object
-
- relations.BasicChunk
-
public class BasicChunk extends Object
- Author:
- Chinh
-
-
Constructor Summary
Constructors Constructor Description BasicChunk()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddChunk(BasicChunk bc)voidaddChunk(Chunk c)voidaddPro(Word pro)voidaddTrg(Word trg)booleanbelongTO(Word trg, Word pr)booleanbelongTO(Word trg, Word pr, Word pr2)booleancontainsKey(Word key)intcountChunks(Word w1, Word w2)voidfindCoordinator(List<Chunk> ls)StringfindTrigger(Word tg, Word pro)StringgetBy_Through(Word tg, Word pr, String[] tokens)ChunkgetChunk(int pos)intgetChunkPos(int pos)StringgetPrep(Word tg, Word pr)List<Word>getPro()booleaninChunk(Word trg, Word pro)booleaninChunkTG(Word trg1, Word trg2)Two tg in the same chunk ; for learning rule onlybooleaninChunkTrg(Word tg, String[] tokens)Check whether a given trigger is in_chunk formbooleanisEmpty()Check whether this basic chunk is empty.booleanisQualify()booleanisSameChunk(Word tg, Word pr)Check whether in the same chunk but not in_chunk formbooleanisSameRole(Word tg1, Word tg2, String[] tokens)Check whether two trigger has the same role (i.e have the same arguments)voidmergeNP()voidprintChunk()intproCount()voidremoveTrg(Word tg)StringtoString()Operation: 1.inttrgCount()
-
-
-
Method Detail
-
isEmpty
public boolean isEmpty()
Check whether this basic chunk is empty.
-
addChunk
public void addChunk(BasicChunk bc)
-
removeTrg
public void removeTrg(Word tg)
-
inChunkTrg
public boolean inChunkTrg(Word tg, String[] tokens)
Check whether a given trigger is in_chunk form- Parameters:
tg-
-
isSameRole
public boolean isSameRole(Word tg1, Word tg2, String[] tokens)
Check whether two trigger has the same role (i.e have the same arguments)- Parameters:
tg1-tg2-tokens-- Returns:
-
isSameChunk
public boolean isSameChunk(Word tg, Word pr)
Check whether in the same chunk but not in_chunk form- Parameters:
tg-pr-- Returns:
-
mergeNP
public void mergeNP()
-
proCount
public int proCount()
-
trgCount
public int trgCount()
-
containsKey
public boolean containsKey(Word key)
-
getChunk
public Chunk getChunk(int pos)
-
isQualify
public boolean isQualify()
-
getChunkPos
public int getChunkPos(int pos)
-
inChunkTG
public boolean inChunkTG(Word trg1, Word trg2)
Two tg in the same chunk ; for learning rule only- Parameters:
trg1-trg2-
-
addChunk
public void addChunk(Chunk c)
-
addPro
public void addPro(Word pro)
-
addTrg
public void addTrg(Word trg)
-
printChunk
public void printChunk()
-
toString
public String toString()
Operation: 1. Check in_chunk: trg and pro in the same chunk, pro preceeds trg, trig's POS is a NN if trg's POS is VBx and trg is a reg event -> PRO is used as cause 2. Find connection: NP prep NP : if trig is NP and not (in_chunk) use known list of preps to connect with another NP 3. Check role: if there is more than one trig in chunk, check relationship (equals, dependent) between trgs two trig are equal if they connected by CC (i.e. and,or) and has the same POS 4. Divide into simple/binding/reg event to make extraction process simpler 5. How to store extracted events? How to assign ID?-> List of extracted event, reference via object ID
-
-