Format Configuration#

Format configuration defines how specific structures in text will be formatted. For example, you can specify how dates should be formatted or how many spaces there should be after the end of the sentence.

Format configuration is specified within the format part of the formatting configuration JSON object (refer to Document Formatting for an example). Below is an example of format configuration showing all available fields.

{
    "format": {
        "end_of_sentence_spacing": "2",
        "numbers": "numeric",
        "ordinal_numbers": "abbreviated",
        "number_range": true,
        "digits": true,
        "DMY_date": "as_dictated",
        "MY_date": "as_dictated",
        "DM_date": "as_dictated",
        "clock_time": true,
        "time_quantity": true,
        "metric_units_abbreviated": true,
        "percent_symbol": true,
        "height_feet_inches": true,
        "temperature_degrees": false,
        "verbalized_punct": true,
        "cranial_nerve": "arabic",
        "jcaho_rules": true,
    }
}

In general, format configuration options work such that specifying an option enables the associated formatting, while not specifying it preserves the default Soniox behavior (which may not correspond to any specific value of the option).

End of sentence spacing#

This configuration defines the number of spaces after the end of a sentence.

end_of_sentence_spacing
  • "1" Use 1 space after each end of sentence (default).
  • "2" Use 2 spaces after each end of sentence.

Examples

Formatted output:

"end_of_sentence_spacing": "1"
This is a sentence. This is another sentence.
"end_of_sentence_spacing": "2"
This is a sentence.  This is another sentence.

Numbers#

This configuration defines if numbers should be written in text or numerically.

numbers
  • "text" Write numbers in text.
  • "numeric" Write numbers using digits.

Examples

Input speech:

two thousand and four

Formatted output:

"numbers": "text"
two thousand and four
"numbers": "numeric"
2004

Ordinal numbers#

This configuration defines if ordinal numbers should be written in text or abbreviated.

ordinal_numbers
  • "text" Write ordinal numbers in text.
  • "abbreviated" Write ordinal numbers abbreviated.

Examples

Input speech:

third
one thousand and first

Formatted output:

"ordinal_numbers": "text"
third
one thousand and first
"ordinal_numbers": "abbreviated"
3rd
1001st

Number ranges#

This configuration formats number ranges. Doesn’t apply to numbers with units.

number_range
  • true

Examples

Input speech:

eight to ten
eight to ten percent
one through five
one over two

Formatted output:

"number_range": true
8-10
eight to ten percent
1-5
1/2

Digits#

This configuration formats sequences of two or more digits or numbers.

digits
  • true

Examples

Input speech:

one two
one two three
one two three four o five
one two three twenty sixteen

Formatted output:

"digits": true
1-2
123
123405
123-2016

Full date#

This configuration defines how a spoken date containing date, month, and year will be formatted.

DMY_date
  • "as_dictated" Write as dictated (numbers always with digits).
  • "Month DD, YYYY"
  • "MM/DD/YYYY"
  • "MM/DD/YY"
  • "DD/MM/YYYY"
  • "DD/MM/YY"

Examples

Input speech:

March second two thousand and four
third of November two thousand and four
one four two thousand and three

Formatted output:

"DMY_date": "as_dictated"
March 2nd 2004
3rd of November 2004
1/4/2003
"DMY_date": "Month DD, YYYY"
March 02, 2004
November 03, 2004
January 04, 2003
"DMY_date": "MM/DD/YYYY"
03/02/2004
11/03/2004
01/04/2003
"DMY_date": "MM/DD/YY"
03/02/04
11/03/04
01/04/03
"DMY_date": "DD/MM/YYYY"
02/03/2004
03/11/2004
04/01/2003
"DMY_date": "DD/MM/YY"
02/03/04
03/11/04
04/01/03

Month-year#

This configuration defines how a spoken date containing only month and year will be formatted.

MY_date
  • "as_dictated" Write as dictated (numbers always with digits).
  • "MM/YYYY"
  • "Month YYYY"

Examples

Input speech:

January two thousand nine
one two thousand nine
three of two thousand nine
March of two thousand nine

Formatted output:

"MY_date": "as_dictated"
January 2009
1/2009
3 of 2009
March of 2009
"MY_date": "MM/YYYY"
01/2009
01/2009
03/2009
03/2009
"MY_date": "Month YYYY"
January 2009
January 2009
March 2009
March 2009

Day-month#

This configuration defines how a spoken date containing only day and month will be written as text.

DM_date
  • "as_dictated" Write as dictated (numbers always with digits).
  • "MM/DD"
  • "DD/MM"`
  • "Month Dth"
  • "Dth of Month"
  • "Month D"
  • "D Month"

Examples

Input speech:

January two
fifth of May
three four

Formatted output:

"DM_date": "as_dictated"
January 2
5th of May
3/4
"DM_date": "MM/DD"
01/02
05/05
03/04
"DM_date": "DD/MM"
02/01
05/05
04/03
"DM_date": "Month Dth"
January 2nd
May 5th
March 4th
"DM_date": "Dth of Month"
2nd of January
5th of May
4th of March
"DM_date": "Month D"
January 2
May 5
March 4
"DM_date": "D Month"
2 January
5 May
4 March

Clock time#

This configuration formats 12-hour clock times.

clock_time
  • true

Examples

Input speech:

ten thirty AM
nine o five AM
five PM

Formatted output:

"clock_time": True
10:30 a.m.
9:05 a.m.
5 p.m.

Time quantity#

This configuration formats time quantities using digits and also abbreviates such ranges using hyphen.

time_quantity
  • true

Examples

Input speech:

ten minutes
twenty to thirty seconds
one hour

Formatted output:

"time_quantity": True
10 minutes
20-30 seconds
1 hour

Metric units#

This configuration enables formatting quantities with metric units using abbreviated units and also abbreviates such ranges using hyphen.

metric_units_abbreviated
  • true

Examples

Input speech:

two centimeters
a meter
eight to twenty kilograms

Formatted output:

"metric_units_abbreviated": True
2 cm
a meter
8-20 kg

Percent symbol#

This configuration abbreviates percent quantities using the percent symbol. It also formats percent quantity ranges, adding the percent symbol to the first value if not already present.

percent_symbol
  • true

Examples

Input speech:

five percent
six percent to ten percent
six to ten percent

Formatted output:

"percent_symbol": true
5%
6% to 10%
6% to 10%

Height (feet-inches)#

This configuration defines how height in feet and inches should be formatted.

height_feet_inches
  • "as_dictated" Write as dictated (numbers always with digits).
  • "symbolic" Write like F'I".
  • "text" Write like F feet I inches.

Examples

Input speech:

five foot three
six feet two inches

Formatted output:

"height_feet_inches": "as_dictated"
5 foot 3
6 feet 2 inches
"height_feet_inches": "symbolic"
5'3"
6'2"
"height_feet_inches": "text"
5 feet 3 inches
6 feet 2 inches

Temperature#

This configuration formats temperature measurements by appending “degrees” if needed.

temperature_degrees
  • true

Examples

Input speech:

temperature 98
temperature is 98

Formatted output:

"temperature_degrees": true
temperature 98 degrees
temperature is 98 degrees

Verbalized punctuation#

This configuration enables interpretation of verbalized punctuation symbols and other formatting instructions.

verbalized_punct
  • true

Examples

Input speech:

A comma B period C question mark D punctuation colon E semicolon
A dash B slash C open parentheses D close parentheses
A new line B new paragraph C

Formatted output (n means newline):

"verbalized_punct": True
A, B. C? D: E;
A-B/C (D)
A\nB\n\nC

Cranial nerves#

This configuration defines how the cranial nerves are formatted.

cranial_nerve
  • "arabic" Write cranial nerves using Arabic numerals.
  • "roman" Write cranial nerves using Roman numerals.

Examples

Input speech:

Cranial nerves two through twelve
Cranial nerve five

Formatted output:

"cranial_nerve": "arabic"
Cranial nerves 2-12
Cranial nerve 5
"cranial_nerve": "roman"
Cranial nerves II-XII
Cranial nerve V

JCAHO rules#

Using this configuration applies JCAHO rules to eliminate dangerous abbreviations.

jcaho_rules
  • true

Examples

Input speech:

5 U
300 I U
q d
q o d
MS
MSO4
MgSO4

Formatted output:

"jcaho_rules": true
5 units
300 international units
daily
every other day
morphine sulfate
magnesium sulfate
magnesium sulfate