Skip to content

The Parser

To process the output of our Language Model correctly, we use a Parser that parses our complicated formal language text into a sequence of SpeechExpressions: Texts tied to emotions.

How it works

The Parser consists of two components: a Lexer and a Parser.

With the Lexer, we perform an analysis on whether or not the symbols are correct. Yielding a Token-Stream that can be lazily accessed at any point by the Parser.

With the Parser, we perform an analysis on whether or not the text we receive matches the rules of our EBNF-Grammar. Yielding an Array of various Expressions that can be easily processed by the TTS.

EBNF-Grammar

For our current specification, the EBNF-Grammar looks like this:

Start ::= 'BEGIN' Emotion Literal { [';'] Emotion Literal } 'END' | 'BEGIN' '[' 'MOVE' ']' Literal 'END'
Emotion ::= '<' ('FRUSTRATED' | 'AMUSED' | 'CALM' | 'SAD' | 'EXCITED' | 'HAPPY' | 'BORED' | 'WORRIED') '>'
Literal ::= '"' identifier '"'

Info

For more information about the EBNF (Extended Backus-Naur form), there is a wikipedia article that explains it.

Examples

BEGIN
<EXCITED> "I love the DFKI so..."
<BORED> "so much..."
END
BEGIN
<FRUSTRATED> "Now I shall make a pause before continuing";
<SAD> "This is the next sentence"
END
BEGIN
[MOVE] "charlie"
END