From 529c9507b208583528065c48c2c70df3c239aed6 Mon Sep 17 00:00:00 2001
From: Jonas Wolff <jonasw96@gmx.net>
Date: Fri, 11 Jan 2019 17:46:50 +0100
Subject: [PATCH] forgot to git add in last commit

---
 example/actions.py          | 83 +++++++++++++++++--------------------
 example/data.tsv            |  1 +
 example/nlu_config.yml.spac | 12 ------
 3 files changed, 38 insertions(+), 58 deletions(-)
 delete mode 100644 example/nlu_config.yml.spac

diff --git a/example/actions.py b/example/actions.py
index 8e97bad..d34dfb3 100644
--- a/example/actions.py
+++ b/example/actions.py
@@ -24,9 +24,11 @@ class ActionSearchBirthplace(Action):
             for row in spamreader:
                 if name_regex.match(row['name']):
                     actual_birthplace = row['birthplace']
-        return [SlotSet('birthplace', actual_birthplace if actual_birthplace is not None else [])]
-        
+        return [SlotSet('birthplace', actual_birthplace
+            if actual_birthplace is not None and actual_birthplace is not ""
+            else "not known")]
         
+
 class ActionUtterBirthplace(Action):
     def name(self):
         return 'action_utter_birthplace'
@@ -34,10 +36,7 @@ class ActionUtterBirthplace(Action):
     def run(self, dispatcher, tracker, domain):
         person = tracker.get_slot('physicist')
         birthplace = tracker.get_slot('birthplace')
-        if  birthplace == None:
-            dispatcher.utter_message("Error: Birthplace of " + person + " not known.")
-        else:
-            dispatcher.utter_message("The birthplace of " + person + " is " + birthplace + ".")
+        dispatcher.utter_message("Birthplace of {} is {}.".format(person, birthplace))
         return []
 
 #
@@ -58,7 +57,9 @@ class ActionSearchDayOfDeath(Action):
             for row in spamreader:
                 if name_regex.match(row['name']):
                     actual_day_of_death = row['day_of_death']
-        return [SlotSet('day_of_death', actual_day_of_death if actual_day_of_death is not None else [])]
+        return [SlotSet('day_of_death', actual_day_of_death 
+            if actual_day_of_death is not None and actual_day_of_death is not ""
+            else "not known")]
         
         
 class ActionUtterDayOfDeath(Action):
@@ -68,10 +69,7 @@ class ActionUtterDayOfDeath(Action):
     def run(self, dispatcher, tracker, domain):
         person = tracker.get_slot('physicist')
         day_of_death = tracker.get_slot('day_of_death')
-        if  day_of_death == None:
-            dispatcher.utter_message("Error: day of death of " + person + "not known.")
-        else:
-            dispatcher.utter_message("The day of death of " + person + " is " + day_of_death + ".")
+        dispatcher.utter_message("The day of death of {} is {}.".format(person, day_of_death))
         return []
 
 #
@@ -92,7 +90,9 @@ class ActionSearchPlaceOfDeath(Action):
             for row in spamreader:
                 if name_regex.match(row['name']):
                     actual_place_of_death = row['place_of_death']
-        return [SlotSet('place_of_death', actual_place_of_death if actual_place_of_death is not None else [])]
+        return [SlotSet('place_of_death', actual_place_of_death
+            if actual_place_of_death is not None and actual_place_of_death is not ""
+            else "not known")]
         
         
 class ActionUtterPlaceOfDeath(Action):
@@ -102,10 +102,7 @@ class ActionUtterPlaceOfDeath(Action):
     def run(self, dispatcher, tracker, domain):
         person = tracker.get_slot('physicist')
         place_of_death = tracker.get_slot('place_of_death')
-        if  place_of_death == None:
-            dispatcher.utter_message("Error: Place of death of " + person + "not known.")
-        else:
-            dispatcher.utter_message("The place of death of " + person + " is " + place_of_death + ".")
+        dispatcher.utter_message("The place of death of {} is {}.".format(person, place_of_death))
         return []
 
 #
@@ -126,7 +123,9 @@ class ActionSearchIsAlive(Action):
             for row in spamreader:
                 if name_regex.match(row['name']):
                     actual_is_alive = row['is_alive']
-        return [SlotSet('is_alive', actual_is_alive if actual_is_alive is not None else [])]
+        return [SlotSet('is_alive', actual_is_alive 
+            if actual_is_alive is not None and actual_is_alive is not ""
+            else "not known")]
         
         
 class ActionUtterIsAlive(Action):
@@ -136,10 +135,7 @@ class ActionUtterIsAlive(Action):
     def run(self, dispatcher, tracker, domain):
         person = tracker.get_slot('physicist')
         is_alive = tracker.get_slot('is_alive')
-        if  is_alive == None:
-            dispatcher.utter_message("Error: Life status of " + person + "not known.")
-        else:
-            dispatcher.utter_message("The Life status of " + person + " is " + is_alive + ".")
+        dispatcher.utter_message("{} is {}.".format(person, is_alive))
         return []
 
 #
@@ -160,7 +156,9 @@ class ActionSearchNumSpouses(Action):
             for row in spamreader:
                 if name_regex.match(row['name']):
                     actual_num_spouses = row['num_spouses']
-        return [SlotSet('num_spouses', actual_num_spouses if actual_num_spouses is not None else [])]
+        return [SlotSet('num_spouses', actual_num_spouses 
+            if actual_num_spouses is not None and actual_num_spouses is not "" 
+            else "not known")]
         
         
 class ActionUtterNumSpouses(Action):
@@ -170,10 +168,7 @@ class ActionUtterNumSpouses(Action):
     def run(self, dispatcher, tracker, domain):
         person = tracker.get_slot('physicist')
         num_spouses = tracker.get_slot('num_spouses')
-        if num_spouses == None:
-            dispatcher.utter_message("Error: Number of Spouses of " + person + "not known.")
-        else:
-            dispatcher.utter_message("The Number of spouses of " + person + " is " + num_spouses + ".")
+        dispatcher.utter_message("The Number of spouses of {} is {}.".format(person, num_spouses))
         return []
 
 #
@@ -194,7 +189,9 @@ class ActionSearchPrimaryEducation(Action):
             for row in spamreader:
                 if name_regex.match(row['name']):
                     actual_primary_education = row['primary_education']
-        return [SlotSet('primary_education', actual_primary_education if actual_primary_education is not None else [])]
+        return [SlotSet('primary_education', actual_primary_education 
+            if actual_primary_education is not None and actual_primary_education is not ""
+            else "not known")]
         
         
 class ActionUtterPrimaryEducation(Action):
@@ -204,10 +201,7 @@ class ActionUtterPrimaryEducation(Action):
     def run(self, dispatcher, tracker, domain):
         person = tracker.get_slot('physicist')
         primary_education = tracker.get_slot('primary_education')
-        if  primary_education == None:
-            dispatcher.utter_message("Error: Primary education of " + person + "not known.")
-        else:
-            dispatcher.utter_message("The primary education of " + person + " is " + primary_education + ".")
+        dispatcher.utter_message("The primary education of {} is {}.".format(person, primary_education))
         return []
 
 #
@@ -228,7 +222,9 @@ class ActionSearchUniversity(Action):
             for row in spamreader:
                 if name_regex.match(row['name']):
                     actual_university = row['university']
-        return [SlotSet('university', actual_university if actual_university is not None else [])]
+        return [SlotSet('university', actual_university
+            if actual_university is not None and actual_university is not "" 
+            else "not known")]
         
         
 class ActionUtterUniversity(Action):
@@ -238,10 +234,7 @@ class ActionUtterUniversity(Action):
     def run(self, dispatcher, tracker, domain):
         person = tracker.get_slot('physicist')
         university = tracker.get_slot('university')
-        if university == None:
-            dispatcher.utter_message("Error: University of " + person + "not known.")
-        else:
-            dispatcher.utter_message("The University of " + person + " is " + university + ".")
+        dispatcher.utter_message("The University of {} is {}.".format(person, university))
         return []
 
 #
@@ -262,7 +255,9 @@ class ActionSearchWorkplace(Action):
             for row in spamreader:
                 if name_regex.match(row['name']):
                     actual_workplace = row['workplace']
-        return [SlotSet('workplace', actual_workplace if actual_workplace is not None else [])]
+        return [SlotSet('workplace', actual_workplace 
+            if actual_workplace is not None and actual_workplace is not ""
+            else "not known")]
         
         
 class ActionUtterWorkplace(Action):
@@ -272,10 +267,7 @@ class ActionUtterWorkplace(Action):
     def run(self, dispatcher, tracker, domain):
         person = tracker.get_slot('physicist')
         workplace = tracker.get_slot('workplace')
-        if  workplace == None:
-            dispatcher.utter_message("Error: Workplace of " + person + "not known.")
-        else:
-            dispatcher.utter_message("The Workplace of " + person + " is " + workplace + ".")
+        dispatcher.utter_message("The Workplace of {} is {}.".format(person, workplace))
         return []
 
 #
@@ -296,7 +288,9 @@ class ActionSearchAwards(Action):
             for row in spamreader:
                 if name_regex.match(row['name']):
                     actual_awards = row['awards']
-        return [SlotSet('awards', actual_awards if actual_awards is not None else [])]
+        return [SlotSet('awards', actual_awards 
+            if actual_awards is not None and actual_awards is not ""
+            else "not known")]
         
         
 class ActionUtterAwards(Action):
@@ -306,8 +300,5 @@ class ActionUtterAwards(Action):
     def run(self, dispatcher, tracker, domain):
         person = tracker.get_slot('physicist')
         awards = tracker.get_slot('awards')
-        if  awards == None:
-            dispatcher.utter_message("Error: Awards of " + person + "not known.")
-        else:
-            dispatcher.utter_message("The Awards of " + person + " are " + awards + ".")
+        dispatcher.utter_message("The Awards of {} are {}".format(person, awards))
         return []
diff --git a/example/data.tsv b/example/data.tsv
index 6e3e2d5..8081562 100644
--- a/example/data.tsv
+++ b/example/data.tsv
@@ -2,3 +2,4 @@ name	birthplace	birthdate	day_of_death	place_of_death	is_alive	num_spouses	prima
 Albert Einstein	Ulm	14.03.1879	18.04.1955	Princeton	False	2.00	Luitpold Gymnasium	University of Bern	phylosophy and theoretical physics	"Swiss Patent Office (Bern) (1902–1909), University of Bern (1908–1909), University of Zurich (1909–1911), Charles University in Prague (1911–1912), ETH Zurich (1912–1914), Prussian Academy of Sciences (1914–1933), Humboldt University "	"Barnard Medal (1920), Nobel Prize in Physics (1921), Matteucci Medal (1921), ForMemRS (1921)[3], Copley Medal (1925)[3], Gold Medal of the Royal Astronomical Society (1926), Max Planck Medal (1929), Time Person of the Centu"							
 Galileo Galilei	Pisa	15.02.1564	08.01.1642	Arcetri	False	1.00	Vallombrosa Abbey	University of Pisa	"astronomy, physics, engineering, natural philosophy and mathematics"	University of Pisa (1589-1592) and University of Padua (1592-1610)	honorary degree by the Jesuit College in Rome							
 Max Planck	Kiel	23.04.1858	04.10.1947	Göttingen	False	2.00	Maximilians gymnasium	"University of Munich, Friedrich Wilhelms University"	"theoretical physics, physical chemistry"	"University of Kiel, University of Göttingen, Kaiser Wilhelm Society"	"Nobel Prize in Physics (1918), Lorentz Medal (1927), Copley Medal (1929), Max Planck Medal (1929), Goethe Prize (1945)"							
+Jules Aarons																		
diff --git a/example/nlu_config.yml.spac b/example/nlu_config.yml.spac
deleted file mode 100644
index 51f8d69..0000000
--- a/example/nlu_config.yml.spac
+++ /dev/null
@@ -1,12 +0,0 @@
-language: "en"
-
-pipeline:
-- name: "nlp_spacy"
-- name: "tokenizer_spacy"
-- name: "intent_entity_featurizer_regex"
-- name: "intent_featurizer_spacy"
-- name: "ner_crf"
-- name: "ner_spacy"
-- name: "ner_synonyms"
-- name: "intent_classifier_sklearn"
-
-- 
GitLab