espnet3.systems.esp2_st.src.normalization.apply_case
Less than 1 minute
espnet3.systems.esp2_st.src.normalization.apply_case
espnet3.systems.esp2_st.src.normalization.apply_case(text: str, case: str) → str
Apply one of st.sh’s case conventions to text.
- Parameters:
- text – The raw transcript or translation.
- case – One of
tc,lcorlc.rm.
- Returns: The text under that convention.
- Raises:ValueError – If
caseis not one ofCASES.
Examples
>>> apply_case("Mr. Smith's dog.", "tc")
"Mr. Smith's dog."
>>> apply_case("Mr. Smith's dog.", "lc")
"mr. smith's dog."
>>> apply_case("Mr. Smith's dog.", "lc.rm")
"mr smith's dog"