Bibliome / alvisnlp

ALvisNLP corpus processing engine
https://bibliome.github.io/alvisnlp/
Apache License 2.0
16 stars 6 forks source link

Browser misses display of lemmatized annotations in the left tree #129

Closed raf64flo closed 2 years ago

raf64flo commented 3 years ago

Using following plan (based on exercise 3 from https://forgemia.inra.fr/bibliome/formation-alvisnlp/-/tree/master/exercices/3-lemmatisation)

<?xml version="1.0" encoding="UTF-8"?>

<alvisnlp-plan id="lemmatisation">
  <read class="XMLReader">
    <sourcePath>../share/BioNLP-ST-2013_Gene_Regulation_Network_train_PubMed.xml</sourcePath>
    <xslTransform>../share/pubmed2alvisnlp.xslt</xslTransform>
  </read>

  <segmentWords class="WoSMig">
    <targetLayerName>words</targetLayerName>
  </segmentWords>

  <segmentSentences class="SeSMig">
    <wordLayerName>words</wordLayerName>
  </segmentSentences>

  <segmentSentencesAndPOSTagging class="GeniaTagger">
    <wordLayerName>words</wordLayerName>
  </segmentSentencesAndPOSTagging>

  <project class="TabularProjector">
    <dictFile>../share/subtiwiki-genes_2020-01-27.txt</dictFile>
    <targetLayerName>genes</targetLayerName>
    <valueFeatures>name,locus-tag</valueFeatures>
    <wordStartCaseInsensitive/>
    <constantAnnotationFeatures>type=GeneOrProtein</constantAnnotationFeatures>
  </project>

  <project-obo-lemma class="OBOProjector">
    <oboFiles>../share/go.obo</oboFiles>
    <targetLayerName>go-lemma</targetLayerName>
    <idFeature>id</idFeature>
    <subject layer="words" feature="lemma" />
    <wordStartCaseInsensitive/>
    <constantAnnotationFeatures>type=GO-LEMMA</constantAnnotationFeatures>
  </project-obo-lemma>

  <project-obo class="OBOProjector">
    <oboFiles>../share/go.obo</oboFiles>
    <targetLayerName>go</targetLayerName>
    <idFeature>id</idFeature>
    <wordStartCaseInsensitive/>
    <constantAnnotationFeatures>type=GO</constantAnnotationFeatures>
  </project-obo>

  <overlaps class="RemoveOverlaps">
    <layerName>go</layerName>
  </overlaps>

  <export class="TabularExport">
    <outDir>.</outDir>
    <corpusFile>export.txt</corpusFile>
    <lines>documents.sections.layer</lines>
    <columns separator=";">
      section.document.@id;
      section.@name;
      @form;
      start ^ "-" ^ end;
      @type;
      @form;
      str:join:', '(nav:features, @key ^ "=" ^ @value);
      str:join:' '(inside:words, @lemma)
    </columns>
  </export>
</alvisnlp-plan>

Then run the browser:

$ alvisnlp -browser lemmatisation.plan

Searching for cells in the first document (PMID10075739) after having selected go-lemma layer should display a match on the left tree, but nothing is currently display.

The browser console displays following error on the clic event:

alvisnlp.js:297 3d259b3
gijgo.min.js:1 Uncaught TypeError: Cannot read properties of undefined (reading 'attr')
    at Object.select (gijgo.min.js:1)
    at w.fn.init.c.select (gijgo.min.js:1)
    at HTMLDivElement.<anonymous> (alvisnlp.js:129)
    at HTMLDivElement.dispatch (jquery-3.3.1.min.js:2)
    at HTMLDivElement.y.handle (jquery-3.3.1.min.js:2)
    at Object.trigger (jquery-3.3.1.min.js:2)
    at HTMLDivElement.<anonymous> (jquery-3.3.1.min.js:2)
    at Function.each (jquery-3.3.1.min.js:2)
    at w.fn.init.each (jquery-3.3.1.min.js:2)
    at w.fn.init.trigger (jquery-3.3.1.min.js:2)
select @ gijgo.min.js:1
c.select @ gijgo.min.js:1
(anonymous) @ alvisnlp.js:129
dispatch @ jquery-3.3.1.min.js:2
y.handle @ jquery-3.3.1.min.js:2
trigger @ jquery-3.3.1.min.js:2
(anonymous) @ jquery-3.3.1.min.js:2
each @ jquery-3.3.1.min.js:2
each @ jquery-3.3.1.min.js:2
trigger @ jquery-3.3.1.min.js:2
showAndExpandNodeArray @ alvisnlp.js:133
focusFrags @ alvisnlp.js:153
onclick @ (index):1
rbossy commented 2 years ago

Fixed in 818f2f233c0cb171502aeaab68abeb42a21f6bb5