Applies some basic formating to transcriptions:
- Capitalize the first word of each sentence
- Add a period to the end
- Fix any "cruft" in the transcription
- etc.
Parameters:
| Name |
Type |
Description |
opts |
|
Properties
| Name |
Type |
Attributes |
Default |
Description |
model |
|
|
|
some models / languages need special handling |
hesitation |
|
<optional>
|
'\u2026'
|
what to put down for a "hesitation" event, defaults to an ellipsis (...) |
|
- Source:
Methods
capitalize(text) → {string}
Capitalizes the first word of a sentence
Parameters:
| Name |
Type |
Description |
text |
|
|
- Source:
Returns:
-
Type
-
string
clean(text, isFinal) → {String}
Formats one or more words, removing special symbols, junk, and spacing for some languages
Parameters:
| Name |
Type |
Description |
text |
|
|
isFinal |
|
|
- Source:
Returns:
-
Type
-
String
handleResult(result)
Creates a new result with all transcriptions formatted
Parameters:
| Name |
Type |
Description |
result |
|
|
- Source:
period(text) → {string}
puts a period on the end of a sentence
Parameters:
| Name |
Type |
Description |
text |
|
|
- Source:
Returns:
-
Type
-
string