Skip to content
This repository has been archived by the owner on Sep 17, 2019. It is now read-only.

Commit

Permalink
clean up
Browse files Browse the repository at this point in the history
  • Loading branch information
missxa committed Apr 26, 2017
1 parent f1c4dee commit 2bf2b94
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 54 deletions.
11 changes: 0 additions & 11 deletions src/main/java/roboy/dialog/personality/SmallTalkPersonality.java
Original file line number Diff line number Diff line change
Expand Up @@ -67,20 +67,11 @@ public SmallTalkPersonality(Verbalizer verbalizer) {
questions.put("movies", moviesQuestions);
questions.put("occupation", occupationQuestions);

// InquiryState inquiry = new InquiryState("How are you?", positive, "That's not good enough. Again: ");
// InquiryState inquiry2 = new InquiryState("So, anything else you want to talk about?", Lists.stringList(), "");
// GenerativeCommunicationState generative = new GenerativeCommunicationState();
// QuestionAnsweringState answer = new QuestionAnsweringState();
// SegueState segue = new SegueState(answer);
// CelebrityState celeb = new CelebrityState(segue);
//TODO detect goodbye from all the states

// build state machine
GreetingState greetings = new GreetingState();
IntroductionState intro = new IntroductionState();
FarewellState farewell = new FarewellState();
WildTalkState wild = new WildTalkState();
GenerativeCommunicationState generative = new GenerativeCommunicationState();
IdleState idle = new IdleState();

QuestionAnsweringState answer = new QuestionAnsweringState(wild);
Expand All @@ -94,8 +85,6 @@ public SmallTalkPersonality(Verbalizer verbalizer) {
greetings.setNextState(intro);
intro.setNextState(ask);
wild.setNextState(answer);
// wild.setSuccess(wild);
// wild.setFailure(farewell);

state = greetings;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -128,39 +128,6 @@ public Reaction react(Interpretation input) {
return new Reaction(this, result);
}


/**
* Checks all its memories (currently only the DBpedia) for an answer to the given
* question.
*
* @param input The interpretation of all inputs
* @param result The list of answers that is possibly replaced
* @return the reaction to the question
*/
@SuppressWarnings("unchecked")
private Reaction innerReaction(Interpretation input,List<Interpretation> result){
// Map<String, Object> pas = (Map<String, Object>) input.getFeature(Linguistics.PAS);
// if(pas!=null && !pas.isEmpty()){
// Relation relation = PASInterpreter.pas2DBpediaRelation(pas);
//// System.out.println("Relation: "+relation);
// for(Memory<Relation> mem : memories){
// try{
// List<Relation> rememberedList = mem.retrieve(relation);
// for (Relation remembered: rememberedList)
// {
// if(remembered!=null&&remembered.object!=null){ // TODO: check for proper role
// result.add(new Interpretation((String)remembered.object.getAttribute(Linguistics.NAME)));
// return new Reaction(top,result);
// }
// }
//
// } catch(Exception e){}
// }
// }
// return inner.react(input);
return new Reaction(this,Lists.interpretationList(new Interpretation("oh man, no idea what to say")));
}

private List<Triple> remember(String predicate, String agens, String patiens){
List<Triple> triples = new ArrayList<>();
for(Triple t: memory){
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -129,13 +129,8 @@ public Reaction react(Interpretation input)
}

// react to the answer of the person

List<Interpretation> reply = checkOwnMemory(input); // if the question was about Roboy

// if (!reply.isEmpty())
// {
// return new Reaction(determineNextState(input), reply);
// }

reply.add(checkRoboyMind()); // in case Roboy knows a person with same name, hobby, etc.
return new Reaction(determineNextState(input), reply);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,8 @@ public List<Interpretation> act() {

@Override
public Reaction react(Interpretation input) {
// String sentence = (String) input.getFeatures().get(Linguistics.SENTENCE);
// if(!sentence.isEmpty()) {
// return new Reaction(super.this, Lists.interpretationList(new Interpretation(callGenerativeModel(sentence))));
// }
//get out of the talking mode when leave the state
talking = false;
// return new Reaction(failure,Lists.interpretationList(new Interpretation(callGenerativeModel(sentence))));
return super.react(input);
}

Expand Down

0 comments on commit 2bf2b94

Please sign in to comment.