You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In the code for folia.py and libfolia, there are several places where we have to check if a Word, Phoneme or Morpheme is to be handled special, e.g. as a Wref.
Examples: (folia.py)
if isinstance(child, (Word, Morpheme, Phoneme)):
#Include REFERENCES to word items instead of word items themselves
attribs['{' + NSFOLIA + '}id'] = child.id
if isinstance(c,Word) or isinstance(c,Morpheme) or isinstance(c, Phoneme):
targets.append(c)
if type is layerclass:
for e2 in layer.select(AbstractSpanAnnotation,set,True, (True, Word, Morpheme)):
if not isinstance(e2, AbstractSpanRole) and self in e2.wrefs():
yield e2
(in the latter case I even wonder if Phoneme is missing there?)
Examples from folia_impl.cxx
for ( const auto& el : data ) {
if ( ( el->element_id() == Word_t ||
el->element_id() == Phoneme_t ||
el->element_id() == Morpheme_t )
&& el->refcount() > 0 ){
xmlNode *t = XmlNewNode( foliaNs(), "wref" );
Maybe it is a good idea to create a property to select those special cases, where Word, Morpheme and Phoneme have a property REFERABLE, or such. It makes the code clearer, faster and more robust.
The text was updated successfully, but these errors were encountered:
In the code for folia.py and libfolia, there are several places where we have to check if a Word, Phoneme or Morpheme is to be handled special, e.g. as a Wref.
Examples: (folia.py)
(in the latter case I even wonder if Phoneme is missing there?)
Examples from folia_impl.cxx
etc.
Maybe it is a good idea to create a property to select those special cases, where Word, Morpheme and Phoneme have a property REFERABLE, or such. It makes the code clearer, faster and more robust.
The text was updated successfully, but these errors were encountered: