private Collection<Expression> createUniqueTriggerExpressions(final ConversationStates state,final Collection<String> triggerStrings,final ExpressionMatcher matcher,final ChatCondition condition,final String reply,final ChatAction action){
  Collection<Expression> triggerExpressions=new ArrayList<Expression>();
  for (  final String triggerString : triggerStrings) {
    final Expression triggerExpression=ConversationParser.createTriggerExpression(triggerString,matcher);
    final Transition existing=get(state,triggerExpression,condition);
    if (existing != null) {
      final String existingReply=existing.getReply();
      final PostTransitionAction existingAction=existing.getAction();
      if ((existingReply != null) && (reply != null) && !existingReply.contains(reply)) {
        existing.setReply(existingReply + " " + reply);
      }
 else {
        existing.setReply(reply);
      }
      if (((action == null) && (existingAction == null)) || ((action != null) && action.equals(existingAction))) {
        return null;
      }
 else {
        logger.warn(speakerNPC.getName() + ": Adding ambiguous state transition: " + existing+ " existingAction='"+ existingAction+ "' newAction='"+ action+ "'");
      }
    }
    triggerExpressions.add(triggerExpression);
  }
  return triggerExpressions;
}

private Collection < Expression > createUniqueTriggerExpressions ( final ConversationStates state , final Collection < String > triggerStrings , final ExpressionMatcher matcher , final ChatCondition condition , final String reply , final ChatAction action ) { Collection < Expression > triggerExpressions = new ArrayList < Expression > ( ) ; for ( final String triggerString : triggerStrings ) { final Expression triggerExpression = ConversationParser . createTriggerExpression ( triggerString , matcher ) ; final Transition existing = get ( state , triggerExpression , condition ) ; if ( existing != null ) { final String existingReply = existing . getReply ( ) ; final PostTransitionAction existingAction = existing . getAction ( ) ; if ( ( existingReply != null ) && ( reply != null ) && ! existingReply . contains ( reply ) ) { existing . setReply ( existingReply + " " + reply ) ; } else { existing . setReply ( reply ) ; } if ( ( ( action == null ) && ( existingAction == null ) ) || ( ( action != null ) && action . equals ( existingAction ) ) ) { return null ; } else { logger . warn ( speakerNPC . getName ( ) + ": Adding ambiguous state transition: " + existing + " existingAction='" + existingAction + "' newAction='" + action + "'" ) ; } } triggerExpressions . add ( triggerExpression ) ; } return triggerExpressions ; }
create a collection of trigger expressions from trigger strings while checking for duplicate transitions .
