프로그래밍/RiveScript

[Tutorial] Redirections

프리월드 2017. 3. 9. 12:21

이번 시간에는 리디렉션(Redirections)에 대해서 알아보겠습니다. 

+ hello
- Hi there!
- Hey!
- Howdy!

+ hey
@ hello

+ hi
@ hello

이 예제에서 보기에 "hey", "hi"로 메시지를 보냈을 때 hello라는 트리거가 동작하도록 리디렉션을 정의하고 있습니다. 

+ * or something{weight=100}
- Or something. {@ <star>}

위의 예제를 합쳐서 "hi or something"라고 메시지를 보내면 "Or something. Hey!" 라고 응답할 것입니다. 와일드 카드로 정의된 트리거에 {@ <star>}태그가 리디렉션을 요청합니다. 하나의 와일드 카드만 사용할 경우에는 <@>과 같이 축약해서도 사용 할 수 있습니다.

+ hello *
- {@ hello} <@>

+ hello
- Hi there!

+ are you a bot
- How did you know I'm a machine?

다음 예제를 실행하여 "Hello, are you a bot?" 라고 입력하면 "Hi there! How did you know I'm a machine?"라고 응답할 것입니다.


'프로그래밍 > RiveScript' 카테고리의 다른 글

[Tutorial] Conditionals  (0) 2017.03.09
[Tutorial] Short Discussions  (2) 2017.03.09
[Tutorial] Priority Triggers  (0) 2017.03.08
[Tutorial] Arrays in Triggers  (0) 2017.03.08
[Tutorial] Alternatives and Optionals  (0) 2017.03.07