Sentence segmentation¶
segment ¶
Sentence segmentation for Odia text.
Examples:
>>> from openodia import sentences
>>> sentences("ଆଜି ୨.୫ କୋଟି ଟଙ୍କା। ଆଗକୁ କଣ?")
['ଆଜି ୨.୫ କୋଟି ଟଙ୍କା।', 'ଆଗକୁ କଣ?']
sentences ¶
sentences(
text: str,
*,
mode: SegmenterMode = "default",
keep_terminators: bool = True,
) -> list[str]
Split text into sentences.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
text
|
str
|
Input string. May be Odia, mixed Odia/Latin, or empty. |
required |
mode
|
SegmenterMode
|
|
'default'
|
keep_terminators
|
bool
|
When |
True
|
Returns:
| Type | Description |
|---|---|
list[str]
|
List of sentences in source order. Empty input returns an empty |
list[str]
|
list. |
Raises:
| Type | Description |
|---|---|
ValueError
|
If |
Examples:
>>> sentences("ଆଜି ୨.୫ କୋଟି। ଆଗକୁ କଣ? ଭଲ ଦିନ!")
['ଆଜି ୨.୫ କୋଟି।', 'ଆଗକୁ କଣ?', 'ଭଲ ଦିନ!']
>>> sentences("ଡଃ ସୁନୀତା ଆସିଲେ। ସେ କଲେଜରେ ପଢ଼ାନ୍ତି।")
['ଡଃ ସୁନୀତା ଆସିଲେ।', 'ସେ କଲେଜରେ ପଢ଼ାନ୍ତି।']