new FormatStream(opts)
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 | Attributes | Default | Description | |||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
opts |
Object |
Properties
|
|||||||||||||||||
options.objectMode |
Boolean |
<optional> |
false | emit |
- Source:
Methods
capitalize(text) → {string}
Capitalizes the first word of a sentence
Parameters:
| Name | Type | Description |
|---|---|---|
text |
String |
- 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 |
String | |
isFinal |
Boolean |
- Source:
Returns:
- Type
- String
formatResult(result, encoding, next)
Creates a new result with all transcriptions formatted
Parameters:
| Name | Type | Description |
|---|---|---|
result |
Object | |
encoding |
String | |
next |
function |
- Source:
period(text) → {string}
Puts a period on the end of a sentence
Parameters:
| Name | Type | Description |
|---|---|---|
text |
String |
- Source:
Returns:
- Type
- string