diff --git a/.classpath b/.classpath
index 80e36c2..fca2913 100644
--- a/.classpath
+++ b/.classpath
@@ -1,143 +1,137 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/build.sbt b/build.sbt
index f16443e..7ba25a2 100644
--- a/build.sbt
+++ b/build.sbt
@@ -1,6 +1,6 @@
name := "brain"
-version := "0.3.1"
+version := "0.3.2"
organization := "Israel Freitas"
diff --git a/lib/aiml-to-xml_0.15.1.jar b/lib/aiml-to-xml_2.10-0.15.3.jar
similarity index 87%
rename from lib/aiml-to-xml_0.15.1.jar
rename to lib/aiml-to-xml_2.10-0.15.3.jar
index 01a3bbc..9e9afaa 100644
Binary files a/lib/aiml-to-xml_0.15.1.jar and b/lib/aiml-to-xml_2.10-0.15.3.jar differ
diff --git a/lib/commons-collections-3.1.jar b/lib/commons-collections-3.1.jar
deleted file mode 100644
index 89c0781..0000000
Binary files a/lib/commons-collections-3.1.jar and /dev/null differ
diff --git a/lib/javax.servlet-3.0.0.v201112011016.jar b/lib/javax.servlet-3.0.0.v201112011016.jar
deleted file mode 100755
index b135409..0000000
Binary files a/lib/javax.servlet-3.0.0.v201112011016.jar and /dev/null differ
diff --git a/lib/mail-1.4.4.jar b/lib/mail-1.4.4.jar
deleted file mode 100755
index 268ccfb..0000000
Binary files a/lib/mail-1.4.4.jar and /dev/null differ
diff --git a/lib/scala-compiler-2.10.0.jar b/lib/scala-compiler-2.10.0.jar
deleted file mode 100755
index ab4a582..0000000
Binary files a/lib/scala-compiler-2.10.0.jar and /dev/null differ
diff --git a/lib/scala-library.jar b/lib/scala-library.jar
deleted file mode 100755
index 689660a..0000000
Binary files a/lib/scala-library.jar and /dev/null differ
diff --git a/lib/scalap-2.10.0.jar b/lib/scalap-2.10.0.jar
deleted file mode 100755
index 4307a5b..0000000
Binary files a/lib/scalap-2.10.0.jar and /dev/null differ
diff --git a/src/main/scala/bootstrap/liftweb/Boot.scala b/src/main/scala/bootstrap/liftweb/Boot.scala
index 6aaf1d2..d43adb1 100644
--- a/src/main/scala/bootstrap/liftweb/Boot.scala
+++ b/src/main/scala/bootstrap/liftweb/Boot.scala
@@ -59,9 +59,6 @@ class Boot {
LiftRules.resourceNames = "i18n/messages" :: LiftRules.resourceNames
LiftRules.resourceNames = "props" :: LiftRules.resourceNames
- // Brain Config Object
- Config.load
-
createDbUnlessAlreadyExists
}
diff --git a/src/main/scala/brain/config/Config.scala b/src/main/scala/brain/config/Config.scala
index dafdc94..f8e23c1 100644
--- a/src/main/scala/brain/config/Config.scala
+++ b/src/main/scala/brain/config/Config.scala
@@ -57,6 +57,8 @@ object Config {
def getGraphDatabasePath = getBrainDataPath+"/databases"
def getKnowledgeBasePath = getBrainDataPath+"/knowledge_base"
def getKnowledgeBaseDir = knowledgeBaseDir
- def getProgramDDirPath = getBrainDataPath + "/programd/"
- def getProgramDConfPath = getBrainDataPath + "/programd/conf/core.xml"
+ def getProgramDDirPath = getBrainDataPath + "/programd"
+ def getProgramDConfPath = getProgramDDirPath + "/conf"
+ def getProgramDCoreFilePath = getProgramDConfPath + "/core.xml"
+ def getProgramDOutputPath = getProgramDDirPath + "/output"
}
\ No newline at end of file
diff --git a/src/main/scala/brain/models/ProgramD.scala b/src/main/scala/brain/models/ProgramD.scala
index e8b5ace..bf6919e 100644
--- a/src/main/scala/brain/models/ProgramD.scala
+++ b/src/main/scala/brain/models/ProgramD.scala
@@ -18,7 +18,8 @@ object ProgramD {
val programDDir = new File(Config.getProgramDDirPath)
if(!programDDir.exists()){
programDDir.mkdir()
- new File(Config.getProgramDDirPath+"/conf").mkdir
+ new File(Config.getProgramDConfPath).mkdir
+ new File(Config.getProgramDDirPath+"/output").mkdir
writeFiles
}
}
@@ -30,7 +31,7 @@ object ProgramD {
def shutdown:Unit= this.core.shutdown
def restart():Unit={
core.shutdown()
- core = new Core(core.getBaseURL(), URLTools.contextualize(core.getBaseURL(), Config.getProgramDConfPath));
+ core = new Core(core.getBaseURL(), URLTools.contextualize(core.getBaseURL(), Config.getProgramDCoreFilePath));
}
private def writeFiles()={
@@ -45,13 +46,13 @@ object ProgramD {
writeSubstitutions
}
private def writeCore()={
- writeFile(Config.getProgramDConfPath, """
+ writeFile(Config.getProgramDCoreFilePath, s"""
http://alicebot.org/2001/AIML-1.0.1
bots.xml
plugins.xml
- file:/var/log/programd/gossip.txt
+ file:${Config.getProgramDOutputPath}/gossip.txt
undefined
@@ -61,7 +62,7 @@ object ProgramD {
org.aitools.programd.predicates.InMemoryPredicateManager
- file:/var/programd/ffpm
+ file:${Config.getProgramDOutputPath}/ffpm
com.mysql.jdbc.Driver
@@ -115,7 +116,7 @@ object ProgramD {
""")
}
private def writeBots()={
- writeFile(Config.getProgramDDirPath+"conf/bots.xml", """
+ writeFile(Config.getProgramDConfPath+"/bots.xml", s"""
@@ -123,25 +124,18 @@ object ProgramD {
-
- /Users/israelfreitas/brain/knowledge_base/*.aiml
-
+ ${Config.getKnowledgeBasePath}/*.aiml
""")
}
private def writePlugins()={
- writeFile(Config.getProgramDDirPath+"conf/plugins.xml", """
+ writeFile(Config.getProgramDConfPath+"/plugins.xml", """
""")
}
private def writePredicates()={
- writeFile(Config.getProgramDDirPath+"conf/predicates.xml", """
+ writeFile(Config.getProgramDConfPath+"/predicates.xml", """
@@ -157,7 +151,7 @@ object ProgramD {
""")
}
private def writeProperties()={
- writeFile(Config.getProgramDDirPath+"conf/properties.xml", """
+ writeFile(Config.getProgramDConfPath+"/properties.xml", """
@@ -189,7 +183,7 @@ object ProgramD {
""")
}
private def writeSentenceSplitters()={
- writeFile(Config.getProgramDDirPath+"conf/sentence-splitters.xml", """
+ writeFile(Config.getProgramDConfPath+"/sentence-splitters.xml", """
@@ -201,7 +195,7 @@ object ProgramD {
""")
}
private def writeSubstitutions()={
- writeFile(Config.getProgramDDirPath+"conf/substitutions.xml", """
+ writeFile(Config.getProgramDConfPath+"/substitutions.xml", """