cite-architecture / ohco2

A cross-platform library for working with collections of texts in the OHCO2 model
https://cite-architecture.github.io/ohco2/
GNU General Public License v3.0
2 stars 1 forks source link

TextRepository.label( urn ) should return the passage-component, if present #44

Closed Eumaeus closed 7 years ago

Eumaeus commented 7 years ago

.label gives the labeling for the bibliographic elements of the URN. If there is a passage component on the URN, that should be included.

neelsmith commented 7 years ago

This is not the behavior I observe in the unit tests I'm running....

can you provide a failing example?

Eumaeus commented 7 years ago

In the ScalaJS app, this code:

println(s"${ngurn} yields label ${O2Model.textRepository.catalog.label(ngurn)}")

yields, e.g.

[Log] urn:cts:latinLit:phi0474.phi052.omar:11.13.4 yields label M. Tullius Cicero, Epistulae Ad Atticum 
[Log] urn:cts:latinLit:phi0474.phi052.omar:11.16.1 yields label M. Tullius Cicero, Epistulae Ad Atticum 
[Log] urn:cts:latinLit:phi0474.phi052.omar:11.16.2 yields label M. Tullius Cicero, Epistulae Ad Atticum 
[Log] urn:cts:latinLit:phi0474.phi052.omar:11.17A.3 yields label M. Tullius Cicero, Epistulae Ad Atticum 
neelsmith commented 7 years ago

As it should: you're invoking the catalog's label function. Change you code to

O2Model.textRepository.label(ngurn)

and see what happens.

Closing: reopen if this is not what you were looking for.