Package relations
Class Chunk
- java.lang.Object
-
- relations.Chunk
-
public class Chunk extends Object
- Author:
- Chinh
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddPro(Word pr)Add proteinvoidaddTrigger(Word trg)Add triggervoidaddWord(String w)booleancontains(Word key)List<Word>getInChunkPro(Word tg, String[] tokens)Get in_chunk pro for a given tgList<Word>getPro(String[] tokens)12.10.2011 Get pro list in form TG_PRO for strict case (no other trigger in between)List<Word>getPro(Word tg, String[] tokens)Get pros (same chunk with trg) that follow the given trigger for pattern: TG - PR This method is used in case there is no prep or trg has JJ/VBx form in noun chunkList<Word>getProFront()12.10.2011 Get pro list for strict case (no other trigger in between)StringgetText()StringgetType()StringgetValues()booleaninChunk(Word trg, Word pro)Check TG and Pro in the same chunk, for use with learning rulesbooleaninChunk(Word trg, Word pro, String[] tokens)Check TG and Pro in the same chunk, for use with learning rulesbooleaninChunkTG(Word tg1, Word tg2)Check two trg in the same chunk, without any pro in between of thembooleanis_inChunk(Word trg, String[] tokens)Check whether a trg has in_chunk formbooleanisQualify()booleanisSameRole(Word tg1, Word tg2, String[] tokens)voidmerge(Chunk c)Merge two chunks: appending a chunk to the current chunkvoidremovePro(int pos)voidremovePRO(Word pro)voidremoveTRG(Word tg)StringtoString()
-
-
-
Constructor Detail
-
Chunk
public Chunk(String type)
-
-
Method Detail
-
addWord
public void addWord(String w)
-
addPro
public void addPro(Word pr)
Add protein
-
addTrigger
public void addTrigger(Word trg)
Add trigger- Parameters:
trg-
-
getType
public String getType()
-
getText
public String getText()
-
merge
public void merge(Chunk c)
Merge two chunks: appending a chunk to the current chunk- Parameters:
c- :chunk
-
removeTRG
public void removeTRG(Word tg)
-
removePRO
public void removePRO(Word pro)
-
removePro
public void removePro(int pos)
-
isQualify
public boolean isQualify()
-
contains
public boolean contains(Word key)
-
inChunkTG
public boolean inChunkTG(Word tg1, Word tg2)
Check two trg in the same chunk, without any pro in between of them- Parameters:
tg1-tg2-- Returns:
- : true if there is no pro between two triggers
-
inChunk
public boolean inChunk(Word trg, Word pro)
Check TG and Pro in the same chunk, for use with learning rules- Parameters:
trg-pro-- Returns:
-
inChunk
public boolean inChunk(Word trg, Word pro, String[] tokens)
Check TG and Pro in the same chunk, for use with learning rules- Parameters:
trg-pro-- Returns:
-
is_inChunk
public boolean is_inChunk(Word trg, String[] tokens)
Check whether a trg has in_chunk form- Parameters:
trg-- Returns:
-
getInChunkPro
public List<Word> getInChunkPro(Word tg, String[] tokens)
Get in_chunk pro for a given tg- Parameters:
tg- : trgtags- : POS tags
-
getPro
public List<Word> getPro(String[] tokens)
12.10.2011 Get pro list in form TG_PRO for strict case (no other trigger in between)- Parameters:
tags-tokens-- Returns:
-
getProFront
public List<Word> getProFront()
12.10.2011 Get pro list for strict case (no other trigger in between)- Parameters:
tags-tokens-- Returns:
-
getPro
public List<Word> getPro(Word tg, String[] tokens)
Get pros (same chunk with trg) that follow the given trigger for pattern: TG - PR This method is used in case there is no prep or trg has JJ/VBx form in noun chunk- Parameters:
tg- : trigger
-
getValues
public String getValues()
-
-