SubwordInfo.fromXmlElement constructor

SubwordInfo.fromXmlElement(
  1. XmlElement data
)

Implementation

factory SubwordInfo.fromXmlElement(XmlElement data) {
  final subword =
      data.getElement(ApiXmlElement.subword.name)!.innerText.trim();
  final subwordUnit =
      data.getElement(ApiXmlElement.subwordUnit.name)!.innerText.trim();
  final reference =
      data.getElement(ApiXmlElement.reference.name)?.innerText.trim();
  final aux = data.getElement(ApiXmlElement.subsenseInfo.name);
  final subsenseInfo = aux == null ? null : SenseInfo.fromXmlElement(aux);
  return SubwordInfo(
    subword: subword,
    subwordUnit: subwordUnit,
    reference: reference,
    subsenseInfo: subsenseInfo,
  );
}