// Path: core/src/main/java/org/aimlang/core/consts/AimlTag.java
// public class AimlTag {
// 
//     public static final String xml = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>";
//     public static final String aiml = "aiml";
//     public static final String category = "category";
//     public static final String topic = "topic";
//     public static final String pattern = "pattern";
//     public static final String template = "template";
//     public static final String random = "random";
//     public static final String li = "li";
//     public static final String star = "star";
//     public static final String index = "index";
//     public static final String bot = "bot";
//     public static final String set = "set";
//     public static final String get = "get";
//     public static final String think = "think";
//     public static final String srai = "srai";
//     public static final String sraix = "sraix";
//     public static final String map = "map";
//     public static final String that = "that";
//     public static final String condition = "condition";
//     public static final String loop = "loop";
//     public static final String learn = "learn";
//     public static final String learnf = "learnf";
//     public static final String eval = "eval";
//     public static final String text = "#text";
//     public static final String comment = "#comment";
//     //Attributes
//     public static final String name = "name";
// 
//     public static String getCloseTag(String name) {
//         return "</" + name + ">";
//     }
// 
//     public static String getOpenTag(String name) {
//         return "<" + name + ">";
//     }
// }
// 
// Path: core/src/main/java/org/aimlang/core/utils/AppUtils.java
// public class AppUtils {
//     private static Random random = new Random();
// 
//     public static <E> E getRandom(List<E> collection) {
//         return collection.get(random.nextInt(collection.size()));
//     }
// 
//     public static String node2String(Node node) {
//         var nodeName = node.getNodeName();
//         var sw = new StringWriter();
//         try {
//             var t = TransformerFactory.newInstance().newTransformer();
//             t.setOutputProperty(OutputKeys.OMIT_XML_DECLARATION, "yes");
//             t.setOutputProperty(OutputKeys.INDENT, "yes");
//             t.transform(new DOMSource(node), new StreamResult(sw));
//         } catch (TransformerException te) {
//             System.out.println("nodeToString Transformer Exception");
//         }
//         return sw.toString()
//                 .replaceAll("(\r\n|\n\r|\r|\n)", " ")
//                 .replaceAll("> ", ">")
//                 .replaceFirst("<" + nodeName + ">", "")
//                 .replaceFirst("</" + nodeName + ">", "");
//     }
// }


import org.aimlang.core.consts.AimlTag;
import org.aimlang.core.utils.AppUtils;
import java.util.List;
package org.aimlang.core.entity;



/**
 * Aiml random tag
 *
 * @author anton
 * @since 21/10/16
 */
public class AimlRandom implements AimlElement {
    private final List<String> options;

    public AimlRandom(List<String> options) {
        this.options = options;
    }

    @Override
    public String getType() {
        return AimlTag.random;
    }

    public String getValue() {
// Path: core/src/main/java/org/aimlang/core/consts/AimlTag.java
// public class AimlTag {
// 
//     public static final String xml = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>";
//     public static final String aiml = "aiml";
//     public static final String category = "category";
//     public static final String topic = "topic";
//     public static final String pattern = "pattern";
//     public static final String template = "template";
//     public static final String random = "random";
//     public static final String li = "li";
//     public static final String star = "star";
//     public static final String index = "index";
//     public static final String bot = "bot";
//     public static final String set = "set";
//     public static final String get = "get";
//     public static final String think = "think";
//     public static final String srai = "srai";
//     public static final String sraix = "sraix";
//     public static final String map = "map";
//     public static final String that = "that";
//     public static final String condition = "condition";
//     public static final String loop = "loop";
//     public static final String learn = "learn";
//     public static final String learnf = "learnf";
//     public static final String eval = "eval";
//     public static final String text = "#text";
//     public static final String comment = "#comment";
//     //Attributes
//     public static final String name = "name";
// 
//     public static String getCloseTag(String name) {
//         return "</" + name + ">";
//     }
// 
//     public static String getOpenTag(String name) {
//         return "<" + name + ">";
//     }
// }
// 
// Path: core/src/main/java/org/aimlang/core/utils/AppUtils.java
// public class AppUtils {
//     private static Random random = new Random();
// 
//     public static <E> E getRandom(List<E> collection) {
//         return collection.get(random.nextInt(collection.size()));
//     }
// 
//     public static String node2String(Node node) {
//         var nodeName = node.getNodeName();
//         var sw = new StringWriter();
//         try {
//             var t = TransformerFactory.newInstance().newTransformer();
//             t.setOutputProperty(OutputKeys.OMIT_XML_DECLARATION, "yes");
//             t.setOutputProperty(OutputKeys.INDENT, "yes");
//             t.transform(new DOMSource(node), new StreamResult(sw));
//         } catch (TransformerException te) {
//             System.out.println("nodeToString Transformer Exception");
//         }
//         return sw.toString()
//                 .replaceAll("(\r\n|\n\r|\r|\n)", " ")
//                 .replaceAll("> ", ">")
//                 .replaceFirst("<" + nodeName + ">", "")
//                 .replaceFirst("</" + nodeName + ">", "");
//     }
// }


// Path: core/src/main/java/org/aimlang/core/entity/AimlRandom.java
import org.aimlang.core.consts.AimlTag;
import org.aimlang.core.utils.AppUtils;
import java.util.List;

package org.aimlang.core.entity;



/**
 * Aiml random tag
 *
 * @author anton
 * @since 21/10/16
 */
public class AimlRandom implements AimlElement {
    private final List<String> options;

    public AimlRandom(List<String> options) {
        this.options = options;
    }

    @Override
    public String getType() {
        return AimlTag.random;
    }

    public String getValue() {
        return AppUtils.getRandom(options);