comparison src/de/mpiwg/anteater/results/impl/ScientificNameResultManager.java @ 7:0c7cf517ff2d

linnaeus results
author jdamerow
date Fri, 09 Nov 2012 16:11:08 -0700
parents 036535fcd179
children
comparison
equal deleted inserted replaced
6:50aeb96a8ee9 7:0c7cf517ff2d
10 import de.mpiwg.anteater.text.TextType; 10 import de.mpiwg.anteater.text.TextType;
11 11
12 public class ScientificNameResultManager extends AResultManager<SpeciesScientificResult> { 12 public class ScientificNameResultManager extends AResultManager<SpeciesScientificResult> {
13 13
14 public final static String SCIENTIFIC_NAME_TAG_Start = "<species_scientific name=\""; 14 public final static String SCIENTIFIC_NAME_TAG_Start = "<species_scientific name=\"";
15 public final static String SCIENTIFIC_NAME_TAG_End = "\">"; 15 public final static String SCIENTIFIC_NAME_ID_ATTR = "\" ncbiID=\"";
16 public final static String SCIENTIFIC_NAME_TAG_End = "\" >";
16 public final static String SCIENTIFIC_NAME_TAG_CLOSE = "</species_scientific>"; 17 public final static String SCIENTIFIC_NAME_TAG_CLOSE = "</species_scientific>";
17 public final static String TAG_TYPE = "scientific_name"; 18 public final static String TAG_TYPE = "scientific_name";
18 19
19 public ScientificNameResultManager(AnteaterConfiguration configuration) { 20 public ScientificNameResultManager(AnteaterConfiguration configuration) {
20 super(configuration); 21 super(configuration);
43 namesOfSum.add(r); 44 namesOfSum.add(r);
44 } 45 }
45 46
46 47
47 for (SpeciesScientificResult name : namesOfSum) { 48 for (SpeciesScientificResult name : namesOfSum) {
48 tags.add(new AnnotationTag(SCIENTIFIC_NAME_TAG_Start + name.getFinding().getScientificName() + SCIENTIFIC_NAME_TAG_End, name.getFinding().getStart(), SCIENTIFIC_NAME_TAG_CLOSE, name.getFinding().getStart() 49 tags.add(new AnnotationTag(SCIENTIFIC_NAME_TAG_Start + name.getFinding().getScientificName() + SCIENTIFIC_NAME_ID_ATTR + (name.getFinding().getNcbiId() != null ? name.getFinding().getNcbiId() : "") + SCIENTIFIC_NAME_TAG_End, name.getFinding().getStart(), SCIENTIFIC_NAME_TAG_CLOSE, name.getFinding().getStart()
49 + name.getFinding().getLength(), TAG_TYPE)); 50 + name.getFinding().getLength(), TAG_TYPE));
50 } 51 }
51 52
52 return tags; 53 return tags;
53 } 54 }