Package relations

Class Chunk


  • public class Chunk
    extends Object
    Author:
    Chinh
    • Field Detail

      • begin

        public int begin
      • end

        public int end
      • is_merged

        public boolean is_merged
    • 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:
      • isSameRole

        public boolean isSameRole​(Word tg1,
                                  Word tg2,
                                  String[] tokens)
      • getInChunkPro

        public List<Word> getInChunkPro​(Word tg,
                                        String[] tokens)
        Get in_chunk pro for a given tg
        Parameters:
        tg - : trg
        tags - : 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()