Skip to content

Commit 8c0d8ff

Browse files
committed
refactor(webvtt): set languages to a list of strings in ProvenanceTrack
Signed-off-by: Cesar Berrospi Ramis <[email protected]>
1 parent dccea7e commit 8c0d8ff

File tree

2 files changed

+17
-10
lines changed

2 files changed

+17
-10
lines changed

docling_core/types/doc/document.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1254,10 +1254,10 @@ class ProvenanceTrack(BaseModel):
12541254
examples=["Mary", "Fred", "Name Surname"],
12551255
description="The cue voice (speaker)",
12561256
)
1257-
language: Optional[str] = Field(
1257+
languages: Optional[list[str]] = Field(
12581258
None,
1259-
examples=["en", "en-GB", "fr-CA"],
1260-
description="Language of the cue in BCP 47 language tag format",
1259+
examples=[["en", "en-GB"], ["fr-CA"]],
1260+
description="Languages of the cue in BCP 47 language tag format",
12611261
)
12621262
classes: Optional[list[str]] = Field(
12631263
None,

docs/DoclingDocument.json

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2196,23 +2196,30 @@
21962196
],
21972197
"title": "Voice"
21982198
},
2199-
"language": {
2199+
"languages": {
22002200
"anyOf": [
22012201
{
2202-
"type": "string"
2202+
"items": {
2203+
"type": "string"
2204+
},
2205+
"type": "array"
22032206
},
22042207
{
22052208
"type": "null"
22062209
}
22072210
],
22082211
"default": null,
2209-
"description": "Language of the cue in BCP 47 language tag format",
2212+
"description": "Languages of the cue in BCP 47 language tag format",
22102213
"examples": [
2211-
"en",
2212-
"en-GB",
2213-
"fr-CA"
2214+
[
2215+
"en",
2216+
"en-GB"
2217+
],
2218+
[
2219+
"fr-CA"
2220+
]
22142221
],
2215-
"title": "Language"
2222+
"title": "Languages"
22162223
},
22172224
"classes": {
22182225
"anyOf": [

0 commit comments

Comments
 (0)