Example #1
0
  /**
   * aggiunge le proprietà presenti.
   *
   * @param event eventoda salvare
   * @param cas oggetto Cas
   */
  private void addProperties(final Event event, final JCas cas) {
    AnnotationIndex<Annotation> annIdx = cas.getAnnotationIndex(PropertyAnnotation.type);
    FSIterator<Annotation> it = annIdx.iterator();

    while (it.hasNext()) {
      PropertyAnnotation annotation = (PropertyAnnotation) it.next();

      String key = annotation.getKey();
      String value = annotation.getValue();

      logger.debug("Aggiunta proprietà\nKey: " + key + "\nValue: " + value);

      event.getProperties().put(key, value);
    }
  }
Example #2
0
  /**
   * Recupera il valore della proprietà kpeopletagpattern.
   *
   * @param cas cas da analizzare
   * @return valore della proprietà kpeopletagpattern
   */
  private String getKpeopleTagPattern(final JCas cas) {
    AnnotationIndex<Annotation> annIdx = cas.getAnnotationIndex(PropertyAnnotation.type);
    FSIterator<Annotation> it = annIdx.iterator();

    String kpeopletagpattern = null;

    while (it.hasNext()) {
      PropertyAnnotation annotation = (PropertyAnnotation) it.next();

      String key = annotation.getKey();
      String value = annotation.getValue();

      if (key.equals("kpeopletagpattern")) {
        kpeopletagpattern = value;
      }
    }

    return kpeopletagpattern;
  }