Beispiel #1
0
 def children(self) -> List[dict]:
     """A list of child words."""
     if self._children is None:
         self._children = []
         for bp in reversed(self.head_base_phrase.modifiers()):
             self._children.append({
                 "surf":
                 convert_mrphs_to_surf(
                     self._base_phrase_to_text(bp,
                                               mode="mrphs",
                                               truncate=False)),
                 "normalized_surf":
                 convert_mrphs_to_surf(
                     self._base_phrase_to_text(bp,
                                               mode="mrphs",
                                               truncate=True)),
                 "mrphs":
                 self._base_phrase_to_text(bp, mode="mrphs",
                                           truncate=False),
                 "normalized_mrphs":
                 self._base_phrase_to_text(bp, mode="mrphs", truncate=True),
                 "reps":
                 self._base_phrase_to_text(bp, mode="reps", truncate=False),
                 "normalized_reps":
                 self._base_phrase_to_text(bp, mode="reps", truncate=True),
                 "adnominal_event_ids":
                 [e.evid for e in bp.adnominal_events],
                 "sentential_complement_event_ids":
                 [e.evid for e in bp.sentential_complement_events],
                 "modifier":
                 "修飾" in bp.tag.features,
                 "possessive":
                 bp.tag.features.get("係", "") == "ノ格",
             })
     return self._children
Beispiel #2
0
    def surf_with_mark_(self, include_modifiers: bool = False) -> str:
        """A surface string with marks.

        Args:
            include_modifiers: If true, tokens of events that modify this event will be included.
        """
        return convert_mrphs_to_surf(self.mrphs_with_mark_(include_modifiers))
Beispiel #3
0
 def surf(self) -> str:
     """A surface string."""
     return convert_mrphs_to_surf(self.mrphs)
Beispiel #4
0
 def normalized_surf(self) -> str:
     """A normalized surface string."""
     if self._normalized_surf is None:
         self._normalized_surf = convert_mrphs_to_surf(
             self.normalized_mrphs)
     return self._normalized_surf
Beispiel #5
0
 def surf(self) -> str:
     """A surface string."""
     if self._surf is None:
         self._surf = convert_mrphs_to_surf(self.mrphs)
     return self._surf