Skip to content

Commit

Permalink
updated README
Browse files Browse the repository at this point in the history
  • Loading branch information
AlmasB committed Apr 20, 2018
1 parent c9f2fd8 commit 761266f
Showing 1 changed file with 57 additions and 0 deletions.
57 changes: 57 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,63 @@ Possible Output:
The orange zebra of the sky is called Mia
```

#### Example 3

Input:

```json
{
"origin" : ["{[helper:{name}]story}"],
"story" : ["{greet.capitalize}! {introduce.optional(75)} {ask} {goodbye}", "{ask} {goodbye}"],
"greet" : ["hi", "hello", "hi there", "hey", "good day"],
"introduce" : ["My name is {helper.capitalize}. I'm your {helperJob} for today.", "The name's {helper.capitalize}. How do you do? I'll be your {helperJob} today.", "I'm {helper.capitalize} and I'm your {helperJob}."],
"helperJob" : ["{jobType.optional(50)} assistant"],
"jobType" : ["digital", "virtual"],
"ask" : ["How {can} I help you?", "How {can} I be of service?", "What {can} I do for you?"],
"can" : ["can", "may", "might"],
"name" : ["Alice", "Bob", "Carl", "David", "Eve", "Francis", "Gerard", "Helen", "Ian", "Jenny"],
"goodbye" : ["You can ask for {helper} next time you need help. {bye.capitalize}!"],
"bye" : ["bye", "goodbye", "until next time", "see you", "take care"]
}
```

Code:

```
Grammar grammar = ...
grammar.flatten();
```

While the possible outputs follow the same (defined) structure, there's a great variety that can be achieved:

```
Good day! My name is Helen. I'm your virtual assistant for today. What may I do for you? You can ask for Helen next time you need help. Take care!
Hey! How can I be of service? You can ask for Ian next time you need help. Bye!
Hi! The name's Helen. How do you do? I'll be your digital assistant today. What may I do for you? You can ask for Helen next time you need help. Goodbye!
How can I help you? You can ask for Eve next time you need help. Until next time!
What can I do for you? You can ask for Eve next time you need help. Until next time!
Good day! How may I help you? You can ask for Eve next time you need help. Goodbye!
Hi there! The name's Helen. How do you do? I'll be your virtual assistant today. What may I do for you? You can ask for Helen next time you need help. Take care!
How can I help you? You can ask for Bob next time you need help. Goodbye!
Hello! My name is Francis. I'm your digital assistant for today. How might I help you? You can ask for Francis next time you need help. Bye!
What can I do for you? You can ask for Jenny next time you need help. See you!
What can I do for you? You can ask for Helen next time you need help. Goodbye!
Hey! My name is Francis. I'm your virtual assistant for today. How can I be of service? You can ask for Francis next time you need help. See you!
How can I be of service? You can ask for Eve next time you need help. Goodbye!
What might I do for you? You can ask for David next time you need help. Take care!
How can I help you? You can ask for Francis next time you need help. Bye!
How can I be of service? You can ask for Alice next time you need help. See you!
Good day! I'm Helen and I'm your assistant. How can I help you? You can ask for Helen next time you need help. Until next time!
How may I be of service? You can ask for Francis next time you need help. See you!
How might I be of service? You can ask for Ian next time you need help. Until next time!
Hi there! How can I be of service? You can ask for Carl next time you need help. See you!
Hi there! My name is Alice. I'm your assistant for today. How might I help you? You can ask for Alice next time you need help. Take care!
How may I help you? You can ask for Alice next time you need help. Goodbye!
Hey! The name's Bob. How do you do? I'll be your virtual assistant today. How can I be of service? You can ask for Bob next time you need help. Until next time!
What may I do for you? You can ask for Gerard next time you need help. See you!
Hello! The name's Alice. How do you do? I'll be your digital assistant today. How may I be of service? You can ask for Alice next time you need help. Until next time!
```

### Maven

```
Expand Down

0 comments on commit 761266f

Please sign in to comment.