summaryrefslogtreecommitdiff
path: root/BJC-Utils2/src/examples
diff options
context:
space:
mode:
authorBenjamin J. Culkin <bjculkin@mix.wvu.edu>2017-10-08 22:39:59 -0300
committerBenjamin J. Culkin <bjculkin@mix.wvu.edu>2017-10-08 22:39:59 -0300
commitc82e3b3b2de0633317ec8fc85925e91422820597 (patch)
tree96567416ce23c5ce85601f9cedc3a94bb1c55cba /BJC-Utils2/src/examples
parentb3ac1c8690c3e14c879913e5dcc03a5f5e14876e (diff)
Start splitting into maven modules
Diffstat (limited to 'BJC-Utils2/src/examples')
-rw-r--r--BJC-Utils2/src/examples/java/bjc/utils/examples/AbbrevMapTest.java59
-rw-r--r--BJC-Utils2/src/examples/java/bjc/utils/examples/BinarySearchTest.java123
-rw-r--r--BJC-Utils2/src/examples/java/bjc/utils/examples/DelimSplitterTest.java504
-rw-r--r--BJC-Utils2/src/examples/java/bjc/utils/examples/ShuntTest.java37
-rw-r--r--BJC-Utils2/src/examples/java/bjc/utils/examples/rangen/DiabloItemGen.java94
-rw-r--r--BJC-Utils2/src/examples/java/bjc/utils/examples/rangen/RandomStringExamples.java64
-rw-r--r--BJC-Utils2/src/examples/java/bjc/utils/examples/sample-ds-files/html.ds10
-rw-r--r--BJC-Utils2/src/examples/java/bjc/utils/examples/sample-ds-files/json.ds23
-rw-r--r--BJC-Utils2/src/examples/java/bjc/utils/examples/test.tree13
9 files changed, 0 insertions, 927 deletions
diff --git a/BJC-Utils2/src/examples/java/bjc/utils/examples/AbbrevMapTest.java b/BJC-Utils2/src/examples/java/bjc/utils/examples/AbbrevMapTest.java
deleted file mode 100644
index ac4ea76..0000000
--- a/BJC-Utils2/src/examples/java/bjc/utils/examples/AbbrevMapTest.java
+++ /dev/null
@@ -1,59 +0,0 @@
-package bjc.utils.examples;
-
-import java.util.Scanner;
-
-import bjc.utils.esodata.AbbrevMap;
-import bjc.utils.funcutils.StringUtils;
-
-/**
- * Test for abbreviation map.
- *
- * @author EVE
- *
- */
-public class AbbrevMapTest {
- /**
- * Main method.
- *
- * @param args
- * Unused CLI args.
- */
- public static void main(final String[] args) {
- final Scanner scn = new Scanner(System.in);
-
- final AbbrevMap map = new AbbrevMap();
-
- System.out.print("Enter a command (blank line to quit): ");
- String ln = scn.nextLine();
-
- while (!ln.equals("")) {
- final String[] commParts = ln.split(" ");
-
- switch (commParts[0]) {
- case "add":
- map.addWords(commParts[1]);
- break;
- case "remove":
- map.removeWords(commParts[1]);
- break;
- case "recalc":
- map.recalculate();
- break;
- case "check":
- final String list = StringUtils.toEnglishList(map.deabbrev(commParts[1]), false);
- System.out.println(list);
- break;
- case "debug":
- System.out.println(map.toString());
- break;
- default:
- System.out.println("Unknown command: " + ln);
- }
-
- System.out.print("Enter a command (blank line to quit): ");
- ln = scn.nextLine();
- }
-
- scn.close();
- }
-}
diff --git a/BJC-Utils2/src/examples/java/bjc/utils/examples/BinarySearchTest.java b/BJC-Utils2/src/examples/java/bjc/utils/examples/BinarySearchTest.java
deleted file mode 100644
index 758af61..0000000
--- a/BJC-Utils2/src/examples/java/bjc/utils/examples/BinarySearchTest.java
+++ /dev/null
@@ -1,123 +0,0 @@
-package bjc.utils.examples;
-
-import java.util.Scanner;
-
-import bjc.utils.funcdata.bst.BinarySearchTree;
-import bjc.utils.funcdata.bst.TreeLinearizationMethod;
-
-/**
- * Example showing how to use the binary search tree.
- *
- * @author ben
- *
- */
-public class BinarySearchTest {
- private static void display(final BinarySearchTree<Character> tree, final Scanner input) {
- System.out.print("What order would you like the tree to be printed in (m for options): ");
- char command;
-
- while (true) {
- command = input.nextLine().charAt(0);
- TreeLinearizationMethod method = null;
-
- switch (command) {
- case 'm':
- System.out.println("Possible tree printing methods: ");
- System.out.println("\tp: Preorder printing (print parent first, then left & right).");
- System.out.println("\ti: Inorder printing (print left first, then parent & right).");
- System.out.println("\to: Postorder printing (print left first, then right & parent).");
- break;
- case 'p':
- method = TreeLinearizationMethod.PREORDER;
- break;
- case 'i':
- method = TreeLinearizationMethod.INORDER;
- break;
- case 'o':
- method = TreeLinearizationMethod.POSTORDER;
- break;
- default:
- System.out.println("ERROR: Unknown command.");
- }
-
- if (method != null) {
- tree.traverse(method, (element) -> {
- System.out.println("Node: " + element);
- return true;
- });
-
- return;
- }
-
- System.out.print("What order would you like the tree to be printed in (m for options): ");
- }
- }
-
- /**
- * Main method of class
- *
- * @param args
- * Unused CLI args
- */
- public static void main(final String[] args) {
- final Scanner input = new Scanner(System.in);
- System.out.println("Binary Tree Constructor/Searcher");
- final BinarySearchTree<Character> tree = new BinarySearchTree<>((o1, o2) -> o1 - o2);
-
- char command = ' ';
- while (command != 'e') {
- System.out.print("Enter a command (m for help): ");
- command = input.nextLine().charAt(0);
-
- switch (command) {
- case 'm':
- System.out.println("Valid commands: ");
- System.out.println("\tm: Display this help message.");
- System.out.println("\te: Exit this program.");
- System.out.println("\ta: Add a node to the binary tree.");
- System.out.println("\td: Display the binary tree.");
- System.out.println("\tr: Remove a node from the binary tree.");
- System.out.println("\tf: Check if a given node is in the binary tree.");
- System.out.println("\tt: Trim all deleted nodes from the tree.");
- System.out.println("\tb: Balance the tree (also trims dead nodes)");
- break;
- case 'a':
- System.out.print("Enter the letter to add to the binary tree: ");
- command = input.nextLine().charAt(0);
-
- tree.addNode(command);
- break;
- case 'r':
- System.out.print("Enter the letter to add to the binary tree: ");
- command = input.nextLine().charAt(0);
-
- tree.deleteNode(command);
- break;
- case 'd':
- display(tree, input);
- break;
- case 'f':
- System.out.print("Enter the letter to add to the binary tree: ");
- command = input.nextLine().charAt(0);
-
- final boolean inTree = tree.isInTree(command);
- if (inTree) {
- System.out.printf("Node %s was found\n", command);
- } else {
- System.out.printf("Node %s was not found\n", command);
- }
- break;
- case 't':
- tree.trim();
- break;
- case 'b':
- tree.balance();
- break;
- default:
- System.out.println("ERROR: Unrecognized command.");
- }
- }
-
- input.close();
- }
-}
diff --git a/BJC-Utils2/src/examples/java/bjc/utils/examples/DelimSplitterTest.java b/BJC-Utils2/src/examples/java/bjc/utils/examples/DelimSplitterTest.java
deleted file mode 100644
index 428f276..0000000
--- a/BJC-Utils2/src/examples/java/bjc/utils/examples/DelimSplitterTest.java
+++ /dev/null
@@ -1,504 +0,0 @@
-package bjc.utils.examples;
-
-import java.io.FileInputStream;
-import java.io.FileNotFoundException;
-import java.io.IOException;
-import java.io.InputStream;
-import java.util.Arrays;
-import java.util.HashMap;
-import java.util.LinkedList;
-import java.util.List;
-import java.util.Map;
-import java.util.Scanner;
-
-import bjc.utils.data.ITree;
-import bjc.utils.funcdata.FunctionalList;
-import bjc.utils.funcdata.IList;
-import bjc.utils.funcutils.StringUtils;
-import bjc.utils.parserutils.delims.DelimiterException;
-import bjc.utils.parserutils.delims.DelimiterGroup;
-import bjc.utils.parserutils.delims.RegexCloser;
-import bjc.utils.parserutils.delims.RegexOpener;
-import bjc.utils.parserutils.delims.SequenceDelimiter;
-import bjc.utils.parserutils.delims.StringDelimiter;
-import bjc.utils.parserutils.splitter.ConfigurableTokenSplitter;
-
-/**
- * Test for {@link SequenceDelimiter} as well as
- * {@link ConfigurableTokenSplitter}
- *
- * @author EVE
- *
- */
-public class DelimSplitterTest {
- private ConfigurableTokenSplitter split;
-
- private StringDelimiter dlm;
-
- private Map<String, String> mirrored;
-
- private Map<String, DelimiterGroup<String>> groups;
-
- boolean verbose;
-
- /*
- * Create a new tester.
- */
- private DelimSplitterTest() {
- loadMirrorDB();
-
- groups = new HashMap<>();
-
- split = new ConfigurableTokenSplitter(true);
-
- dlm = new StringDelimiter();
-
- verbose = true;
- }
-
- private void loadMirrorDB() {
- mirrored = new HashMap<>();
-
- final InputStream stream = getClass().getResourceAsStream("/BidiMirrorDB.txt");
-
- try (Scanner scn = new Scanner(stream)) {
- String ln = "";
-
- while (scn.hasNextLine()) {
- ln = scn.nextLine();
-
- if (ln.equals("")) {
- continue;
- }
- if (ln.startsWith("#")) {
- continue;
- }
-
- final int cp1 = Integer.parseInt(ln.substring(0, 4), 16);
- final int cp2 = Integer.parseInt(ln.substring(6, 10), 16);
-
- final char[] cpa1 = Character.toChars(cp1);
- final char[] cpa2 = Character.toChars(cp2);
-
- final String cps1 = new String(cpa1);
- final String cps2 = new String(cpa2);
-
- mirrored.put(cps1, cps2);
- }
- }
- }
-
- /*
- * Run the tester interface.
- */
- private void runLoop() {
- final Scanner scn = new Scanner(System.in);
-
- System.out.print("Enter a command (blank line to quit): ");
- String inp = scn.nextLine().trim();
- System.out.println();
-
- while (!inp.equals("")) {
- handleCommand(inp, scn, true);
-
- System.out.println();
-
- System.out.print("Enter a command (blank line to quit): ");
- inp = scn.nextLine();
-
- System.out.println();
- }
-
- scn.close();
- }
-
- /*
- * Handle a input command.
- */
- private void handleCommand(final String inp, final Scanner scn, final boolean isInteractive) {
- if (inp.equals("")) return;
-
- int idx = inp.indexOf(' ');
-
- if (idx == -1) {
- idx = inp.length();
- }
-
- final String command = inp.substring(0, idx);
-
- final String args = inp.substring(idx).trim();
- final String[] argArray = args.split(" ");
-
- switch (command) {
- case "test":
- handleTest(args, false);
- break;
- case "test-ws":
- handleTest(args, true);
- break;
- case "splitter-split":
- handleSplit(argArray);
- break;
- case "splitter-compile":
- split.compile();
- if (verbose) {
- System.out.println("Compiled splitter");
- }
- break;
- case "splitter-add":
- split.addSimpleDelimiters(argArray);
- if (verbose) {
- System.out.println("Added delimiters " + StringUtils.toEnglishList(argArray, true));
- }
- break;
- case "splitter-addmulti":
- split.addMultiDelimiters(argArray);
- if (verbose) {
- System.out.println(
- "Added multi-delimiters " + StringUtils.toEnglishList(argArray, true));
- }
- break;
- case "splitter-addmatch":
- for (final String arg : argArray) {
- split.addSimpleDelimiters(arg, mirrored.get(arg));
- }
- if (verbose) {
- System.out.println("Added matched delimiters "
- + StringUtils.toEnglishList(argArray, true));
- }
- break;
- case "splitter-debug":
- System.out.println(split.toString());
- break;
- case "splitter-reset":
- split = new ConfigurableTokenSplitter(true);
- if (verbose) {
- System.out.println("Reset splitter");
- }
- break;
-
- case "delims-addgroup":
- for (final String arg : argArray) {
- dlm.addGroup(groups.get(arg));
- }
- if (verbose) {
- System.out.println("Added groups " + StringUtils.toEnglishList(argArray, true));
- }
- break;
- case "delims-setinitial":
- dlm.setInitialGroup(groups.get(argArray[0]));
- if (verbose) {
- System.out.println("Set initial group");
- }
- break;
- case "delims-debug":
- System.out.println(dlm.toString());
- break;
- case "delims-test":
- handleDelim(args);
- break;
- case "delims-reset":
- dlm = new StringDelimiter();
- if (verbose) {
- System.out.println("Reset delimiter");
- }
- break;
- case "delimgroups-new":
- for (final String arg : argArray) {
- groups.put(arg, new DelimiterGroup<>(arg));
- }
- if (verbose) {
- System.out.println("Created groups " + StringUtils.toEnglishList(argArray, true));
- }
- break;
- case "delimgroups-edit":
- for (final String arg : argArray) {
- handleEditGroup(arg, scn, isInteractive);
- }
- break;
- case "delimgroups-debug":
- for (final DelimiterGroup<String> group : groups.values()) {
- System.out.println(group.toString());
- }
- break;
- case "delimgroups-reset":
- dlm = new StringDelimiter();
- groups = new HashMap<>();
- if (verbose) {
- System.out.println("Reset delimiter groups + delimiter");
- }
- break;
- case "load-file":
- handleLoadFile(args);
- break;
- default:
- System.out.println("Unknown command ");
- }
-
- }
-
- /*
- * Load script commands from a file.
- */
- private void handleLoadFile(final String args) {
- String pth = args;
-
- if (args.startsWith("\"")) {
- pth = args.substring(1, args.length() - 1);
- }
-
- try (FileInputStream fis = new FileInputStream(pth)) {
- final Scanner scn = new Scanner(fis);
-
- while (scn.hasNextLine()) {
- final String ln = scn.nextLine().trim();
-
- if (ln.equals("")) {
- continue;
- }
- if (ln.startsWith("#")) {
- continue;
- }
-
- if (verbose) {
- System.out.println("\nRead command '" + ln + "' from file\n");
- }
- handleCommand(ln, scn, false);
- }
-
- scn.close();
- } catch (final FileNotFoundException fnfex) {
- System.out.println("Couldn't find file '" + args + "'");
- } catch (final IOException ioex) {
- System.out.println("I/O error with file '" + args + "'\nCause: " + ioex.getMessage());
- }
- }
-
- /*
- * Handle editing a group.
- */
- private void handleEditGroup(final String arg, final Scanner scn, final boolean isInteractive) {
- if (!groups.containsKey(arg)) {
- System.out.println("No group named '" + arg + "'");
- return;
- }
-
- final DelimiterGroup<String> group = groups.get(arg);
-
- if (verbose) {
- System.out.println("Editing group '" + arg + "'");
- }
- if (isInteractive) {
- System.out.println("Enter command (blank line to stop editing): ");
- }
-
- String ln = scn.nextLine().trim();
-
- while (!ln.equals("")) {
- int idx = ln.indexOf(' ');
-
- if (idx == -1) {
- idx = ln.length();
- }
-
- final String command = ln.substring(0, idx);
-
- final String args = ln.substring(idx).trim();
- final String[] argArray = args.split(" ");
-
- switch (command) {
- case "add-closing":
- group.addClosing(argArray);
- if (verbose) {
- System.out.println(
- "Added closers " + StringUtils.toEnglishList(argArray, true));
- }
- break;
- case "add-tlexclude":
- group.addTopLevelForbid(argArray);
- if (verbose) {
- System.out.println("Added top-level exclusions "
- + StringUtils.toEnglishList(argArray, true));
- }
- break;
- case "add-exclude":
- group.addTopLevelForbid(argArray);
- if (verbose) {
- System.out.println("Added nested exclusions "
- + StringUtils.toEnglishList(argArray, true));
- }
- break;
- case "add-subgroup":
- group.addSubgroup(argArray[0], Integer.parseInt(argArray[1]));
- if (verbose) {
- System.out.printf("Added subgroup %s with priority %s\n", argArray[0],
- argArray[1]);
- }
- break;
- case "add-implied-subgroup":
- group.implySubgroup(argArray[0], argArray[1]);
- if (verbose) {
- System.out.printf("Made closer '%s' imply a '%s' subgroup\n", argArray[0],
- argArray[1]);
- }
- break;
- case "add-opener":
- group.addOpener(argArray[0], argArray[1]);
- if (verbose) {
- System.out.printf("Added opener '%s' for group '%s'\n", argArray[0],
- argArray[1]);
- }
- break;
- case "add-reopener":
- group.addPredOpener(new RegexOpener(argArray[0], argArray[1]));
- if (verbose) {
- System.out.printf("Added regex '%s' as opener for '%s'\n", argArray[1],
- argArray[0]);
- }
- break;
- case "add-recloser":
- group.addPredCloser(new RegexCloser(argArray[0]));
- if (verbose) {
- System.out.printf("Added parameterized string '%s' as closer\n", argArray[0]);
- }
- break;
- case "debug":
- System.out.println(group.toString());
- break;
- default:
- System.out.println("Unknown command " + command);
- }
-
- if (isInteractive) {
- System.out.println("Enter command (blank line to stop editing): ");
- }
-
- ln = scn.nextLine().trim();
- }
-
- if (verbose) {
- System.out.println("Finished editing group '" + arg + "'");
- }
- }
-
- private void handleDelim(final String args) {
- try {
- final ITree<String> res = dlm.delimitSequence(args.split(" "));
-
- printDelimSeq(res);
- } catch (final DelimiterException dex) {
- System.out.println("Expression '" + args + "' isn't properly delimited.\n\tCause: "
- + dex.getMessage());
- }
- }
-
- private void handleSplit(final String[] argArray) {
- for (int i = 0; i < argArray.length; i++) {
- final String arg = argArray[i];
-
- final IList<String> strangs = split.split(arg);
-
- System.out.printf("%d '%s' %s\n", i, arg, strangs);
- }
- }
-
- private void handleTest(final String inp, final boolean splitWS) {
- IList<String> strings;
-
- try {
- strings = split.split(inp);
- } catch (final IllegalStateException isex) {
- System.out.println("Splitter must be compiled at least once before use.");
- return;
- }
-
- System.out.println("Split tokens: " + strings);
-
- if (splitWS) {
- final List<String> tks = new LinkedList<>();
-
- for (final String strang : strings) {
- tks.addAll(Arrays.asList(strang.split(" ")));
- }
-
- strings = new FunctionalList<>(tks);
- }
- try {
- final ITree<String> delim = dlm.delimitSequence(strings.toArray(new String[0]));
-
- printDelimSeq(delim);
- } catch (final DelimiterException dex) {
- System.out.println("Expression isn't properly delimited.");
- System.out.println("Cause: " + dex.getMessage());
- }
- }
-
- private void printDelimSeq(final ITree<String> delim) {
- System.out.println("Delimited tokens:\n" + delim.getChild(1).toString());
- System.out.print("Delimited expr: ");
- printDelimTree(delim);
- System.out.println();
- System.out.println();
-
- System.out.println();
- }
-
- private void printDelimTree(final ITree<String> tree) {
- final StringBuilder sb = new StringBuilder();
-
- intPrintDelimTree(tree.getChild(1), sb);
-
- System.out.println(sb.toString().replaceAll("\\s+", " "));
- }
-
- private void intPrintDelimTree(final ITree<String> tree, final StringBuilder sb) {
- tree.doForChildren((child) -> {
- intPrintDelimNode(child, sb);
- });
- }
-
- private void intPrintDelimNode(final ITree<String> tree, final StringBuilder sb) {
- if (tree.getHead().equals("contents")) {
- intPrintDelimTree(tree, sb);
- return;
- }
-
- switch (tree.getChildrenCount()) {
- case 0:
- sb.append(tree.getHead());
- sb.append(" ");
-
- break;
- case 1:
- intPrintDelimTree(tree.getChild(0), sb);
-
- break;
- case 2:
- intPrintDelimTree(tree.getChild(0).getChild(0), sb);
- intPrintDelimNode(tree.getChild(1), sb);
-
- break;
- case 3:
- intPrintDelimNode(tree.getChild(0), sb);
-
- final ITree<String> contents = tree.getChild(1);
-
- intPrintDelimTree(contents.getChild(0), sb);
- intPrintDelimNode(tree.getChild(2), sb);
-
- break;
- }
- }
-
- /**
- * Main method
- *
- * @param args
- * Unused CLI args.
- */
- public static void main(final String[] args) {
- final DelimSplitterTest tst = new DelimSplitterTest();
-
- tst.runLoop();
- }
-}
diff --git a/BJC-Utils2/src/examples/java/bjc/utils/examples/ShuntTest.java b/BJC-Utils2/src/examples/java/bjc/utils/examples/ShuntTest.java
deleted file mode 100644
index ed530ed..0000000
--- a/BJC-Utils2/src/examples/java/bjc/utils/examples/ShuntTest.java
+++ /dev/null
@@ -1,37 +0,0 @@
-package bjc.utils.examples;
-
-import java.util.Scanner;
-
-import bjc.utils.funcdata.FunctionalStringTokenizer;
-import bjc.utils.funcdata.IList;
-import bjc.utils.parserutils.ShuntingYard;
-
-/**
- * Test of shunting yard
- *
- * @author ben
- *
- */
-public class ShuntTest {
- /**
- * Main method
- *
- * @param args
- * Unused CLI args
- */
- public static void main(final String[] args) {
- final Scanner inputSource = new Scanner(System.in);
-
- System.out.print("Enter a expression to shunt: ");
- final String line = inputSource.nextLine();
-
- final ShuntingYard<String> yard = new ShuntingYard<>(true);
-
- final IList<String> preTokens = new FunctionalStringTokenizer(line).toList(strang -> strang);
- final IList<String> shuntedTokens = yard.postfix(preTokens, strang -> strang);
-
- System.out.println(shuntedTokens.toString());
-
- inputSource.close();
- }
-}
diff --git a/BJC-Utils2/src/examples/java/bjc/utils/examples/rangen/DiabloItemGen.java b/BJC-Utils2/src/examples/java/bjc/utils/examples/rangen/DiabloItemGen.java
deleted file mode 100644
index 250318f..0000000
--- a/BJC-Utils2/src/examples/java/bjc/utils/examples/rangen/DiabloItemGen.java
+++ /dev/null
@@ -1,94 +0,0 @@
-package bjc.utils.examples.rangen;
-
-import bjc.utils.funcdata.FunctionalStringTokenizer;
-import bjc.utils.funcdata.IList;
-import bjc.utils.gen.WeightedGrammar;
-
-/**
- * Example showing how to use the weighted random number generator.
- *
- * @author ben
- *
- */
-public class DiabloItemGen {
- private static WeightedGrammar<String> rules = new WeightedGrammar<>();
-
- private static void addCase(final String ruleName, final int probability, final String ruleParts) {
- final IList<String> parts = FunctionalStringTokenizer.fromString(ruleParts).toList(strang -> strang);
-
- rules.addCase(ruleName, probability, parts);
- }
-
- private static void addInfixRules() {
- final String rn = "<infix>";
-
- addCase(rn, 60, "sword");
- addCase(rn, 50, "armor");
- addCase(rn, 40, "rune");
- addCase(rn, 30, "scroll");
- addCase(rn, 20, "potion");
- addCase(rn, 10, "helm");
- }
-
- private static void addItemRules() {
- final String rn = "<item>";
-
- addCase(rn, 10, "<infix>");
- addCase(rn, 20, "<prefix> <infix>");
- addCase(rn, 30, "<infix> <suffix>");
- addCase(rn, 40, "<prefix> <infix> <suffix>");
- addCase(rn, 50, "<prefix> <prefix> <infix>");
- addCase(rn, 60, "<prefix> <prefix> <infix> <suffix>");
- }
-
- private static void addPrefixRules() {
- final String rn = "<prefix>";
-
- addCase(rn, 60, "sturdy");
- addCase(rn, 50, "fine");
- addCase(rn, 40, "strong");
- addCase(rn, 30, "azure");
- addCase(rn, 20, "crimson");
- addCase(rn, 10, "phasing");
- }
-
- private static void addSuffixRules() {
- final String rn = "<suffix>";
-
- addCase(rn, 60, "of Health");
- addCase(rn, 50, "of Wealth");
- addCase(rn, 40, "of Life");
- addCase(rn, 30, "of the Jackal");
- addCase(rn, 20, "of Vitality");
- addCase(rn, 10, "of Ability");
- }
-
- /**
- * Main Method
- *
- * @param args
- * Unused CLI args
- */
- public static void main(final String[] args) {
- rules.addRule("<item>");
- addItemRules();
-
- rules.addRule("<suffix>");
- addSuffixRules();
-
- rules.addRule("<prefix>");
- addPrefixRules();
-
- rules.addRule("<infix>");
- addInfixRules();
-
- for (int i = 0; i < 100; i++) {
- final IList<String> ls = rules.generateListValues("<item>", " ");
-
- final StringBuilder sb = new StringBuilder();
- ls.forEach(sb::append);
-
- System.out.println(sb.toString().replaceAll("\\s+", " "));
- }
- }
-}
diff --git a/BJC-Utils2/src/examples/java/bjc/utils/examples/rangen/RandomStringExamples.java b/BJC-Utils2/src/examples/java/bjc/utils/examples/rangen/RandomStringExamples.java
deleted file mode 100644
index a84f70d..0000000
--- a/BJC-Utils2/src/examples/java/bjc/utils/examples/rangen/RandomStringExamples.java
+++ /dev/null
@@ -1,64 +0,0 @@
-package bjc.utils.examples.rangen;
-
-import bjc.utils.funcdata.FunctionalList;
-import bjc.utils.funcdata.FunctionalStringTokenizer;
-import bjc.utils.funcdata.IList;
-import bjc.utils.gen.RandomGrammar;
-
-/**
- * Examples of random grammar
- *
- * @author ben
- *
- */
-public class RandomStringExamples {
- private static RandomGrammar<String> rg;
-
- private static void addRule(final String rule, final String... cases) {
- final IList<IList<String>> cses = new FunctionalList<>();
-
- for (final String strang : cases) {
- final IList<String> lst = FunctionalStringTokenizer.fromString(strang).toList(s -> s);
-
- cses.add(lst);
- }
-
- rg.makeRule(rule, cses);
- }
-
- /**
- * Main method
- *
- * @param args
- * Unused CLI args
- */
- public static void main(final String[] args) {
- rg = new RandomGrammar<>();
-
- addRule("<sentance>", "<person> <opines> <something>", "<person> thinks that I am <property>",
- "I <opine> <something>", "You think that I am <property>");
-
- addRule("<activity>", "dancing", "eating", "sleeping");
-
- addRule("<object>", "<person>", "life", "my computer", "my friends");
-
- addRule("<opine>", "hate", "am jealous of", "love");
-
- addRule("<opines>", "hates", "loves");
-
- addRule("<person>", "my sister", "my father", "my girlfriend", "the man next door");
-
- addRule("<property>", "creative", "intelligent");
-
- addRule("<something>", "<activity>", "<activity> with <person>", "<object>");
-
- for (int i = 0; i < 10; i++) {
- final IList<String> ls = rg.generateListValues("<sentance>", " ");
-
- final StringBuilder sb = new StringBuilder();
- ls.forEach(sb::append);
-
- System.out.println(sb.toString().replaceAll("\\s+", " "));
- }
- }
-}
diff --git a/BJC-Utils2/src/examples/java/bjc/utils/examples/sample-ds-files/html.ds b/BJC-Utils2/src/examples/java/bjc/utils/examples/sample-ds-files/html.ds
deleted file mode 100644
index 103fa12..0000000
--- a/BJC-Utils2/src/examples/java/bjc/utils/examples/sample-ds-files/html.ds
+++ /dev/null
@@ -1,10 +0,0 @@
-delimgroups-new tag initial
-
-delimgroups-edit tag
- add-recloser </%2$s>
-
-delimgroups-edit initial
- add-reopener tag <(\w+)>
-
-delims-addgroup tag initial
-delims-setinitial initial \ No newline at end of file
diff --git a/BJC-Utils2/src/examples/java/bjc/utils/examples/sample-ds-files/json.ds b/BJC-Utils2/src/examples/java/bjc/utils/examples/sample-ds-files/json.ds
deleted file mode 100644
index d110d95..0000000
--- a/BJC-Utils2/src/examples/java/bjc/utils/examples/sample-ds-files/json.ds
+++ /dev/null
@@ -1,23 +0,0 @@
-splitter-addmatch ( { [
-splitter-add : , "
-splitter-compile
-
-delimgroups-new braces brackets initial
-delimgroups-edit braces
- add-closing }
- add-subgroup : 0
- add-subgroup , 1
- add-implied-subgroup } ,
-
-delimgroups-edit brackets
- add-subgroup , 0
- add-closing ]
- add-implied-subgroup ] ,
-
-delimgroups-edit initial
- add-opener { braces
- add-opener [ brackets
-
-delims-addgroup braces brackets initial
-
-delims-setinitial initial \ No newline at end of file
diff --git a/BJC-Utils2/src/examples/java/bjc/utils/examples/test.tree b/BJC-Utils2/src/examples/java/bjc/utils/examples/test.tree
deleted file mode 100644
index 795cc88..0000000
--- a/BJC-Utils2/src/examples/java/bjc/utils/examples/test.tree
+++ /dev/null
@@ -1,13 +0,0 @@
-test 1
- 1
- 1
- 2
- 2
- 1
-
-simp 1
- 2
- 3
- 4
- 3
- 2 \ No newline at end of file