Skip to content

Commit

Permalink
Add types to _create_documents_from_neume_ngrams
Browse files Browse the repository at this point in the history
  • Loading branch information
dchiller committed May 14, 2024
1 parent 322a7b6 commit 526011d
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions app/public/cantusdata/helpers/mei_processing/mei_tokenizer.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,15 @@
"""

import uuid
from typing import List, Tuple, Optional
from typing import List, Tuple, Optional, Never, Union
from .mei_parser import MEIParser
from .mei_parsing_types import (
Neume,
NeumeComponent,
ContourType,
NeumeName,
NgramDocument,
Zone,
)
from .bounding_box_utils import combine_bounding_boxes, stringify_bounding_boxes

Expand Down Expand Up @@ -82,8 +83,10 @@ def _create_document_from_neume_components(
pitch_names, contour, intervals = self._stringify_neume_component_data(
neume_components
)
zones_with_sys = [(nc["bounding_box"], nc["system"]) for nc in neume_components]
location = stringify_bounding_boxes(combine_bounding_boxes(zones_with_sys))
zones_with_sys: List[Tuple[Zone, int]] = [
(nc["bounding_box"], nc["system"]) for nc in neume_components
]
location: str = stringify_bounding_boxes(combine_bounding_boxes(zones_with_sys))
return {
"location": location,
"pitch_names": pitch_names,
Expand Down

0 comments on commit 526011d

Please sign in to comment.