From 1f89200da6cf87c1e1ed14bd6c5577a7bac871aa Mon Sep 17 00:00:00 2001 From: vle Date: Mon, 23 Mar 2020 09:10:38 -0400 Subject: [PATCH 1/7] initial commit --- Hurtlocker.iml | 18 ------------------ src/main/java/JerksonObject.java | 2 ++ 2 files changed, 2 insertions(+), 18 deletions(-) delete mode 100644 Hurtlocker.iml create mode 100644 src/main/java/JerksonObject.java diff --git a/Hurtlocker.iml b/Hurtlocker.iml deleted file mode 100644 index 22967e8..0000000 --- a/Hurtlocker.iml +++ /dev/null @@ -1,18 +0,0 @@ - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/src/main/java/JerksonObject.java b/src/main/java/JerksonObject.java new file mode 100644 index 0000000..7771670 --- /dev/null +++ b/src/main/java/JerksonObject.java @@ -0,0 +1,2 @@ +public class JerksonObject { +} From aff46dd90ddb8c9cadbbccd31f36db1ad51b3acf Mon Sep 17 00:00:00 2001 From: vle Date: Mon, 23 Mar 2020 14:01:19 -0400 Subject: [PATCH 2/7] got someting need to fix bug --- src/main/java/JerksonObject.java | 16 ++++ src/main/java/JerksonParser.java | 143 +++++++++++++++++++++++++++++++ src/main/java/Main.java | 9 +- target/classes/Main.class | Bin 1162 -> 1217 bytes 4 files changed, 167 insertions(+), 1 deletion(-) create mode 100644 src/main/java/JerksonParser.java diff --git a/src/main/java/JerksonObject.java b/src/main/java/JerksonObject.java index 7771670..76141b4 100644 --- a/src/main/java/JerksonObject.java +++ b/src/main/java/JerksonObject.java @@ -1,2 +1,18 @@ +import java.util.LinkedHashMap; +import java.util.Map; + public class JerksonObject { + Map obj; + + public JerksonObject(){ + obj = new LinkedHashMap(); + } + + public Map getObj(){ + return obj; + } + + public Boolean containsValue(String value){ + return obj.containsValue(value); + } } diff --git a/src/main/java/JerksonParser.java b/src/main/java/JerksonParser.java new file mode 100644 index 0000000..7648121 --- /dev/null +++ b/src/main/java/JerksonParser.java @@ -0,0 +1,143 @@ +import java.util.LinkedList; +import java.util.List; +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +public class JerksonParser { + private final String seperator = "##"; + private Pattern patt; + private Matcher match; + List grocery; + + public JerksonParser(){ + grocery = new LinkedList(); + } + + public String[] getObjects(String input){ + patt = Pattern.compile("[!;%*^#@]"); + return patt.split(input); + } + + public void makeObjects(String[] inputArr){ + patt = Pattern.compile("(?i)(?<=name:).*"); + Pattern price = Pattern.compile("(?i)(?<=price:).*"); + Pattern type = Pattern.compile("(?<=type:).*"); + Pattern exp = Pattern.compile("(?<=expiration:).*"); + for(int i = 0; i < inputArr.length; i++){ + JerksonObject obj = new JerksonObject(); + match = patt.matcher(inputArr[i]); + if(match.find()) + obj.getObj().put("name", makeCorrectName(match.group())); + else + obj.getObj().put("name", "null"); + i++; + match = price.matcher(inputArr[i]); + if(match.find()) { + if(!match.group().equals("")) + obj.getObj().put("price", match.group()); + else + obj.getObj().put("price", "null"); + } + else + obj.getObj().put("price", "null"); + i++; + match = type.matcher(inputArr[i]); + if(match.find()) + obj.getObj().put("type", match.group()); + else + obj.getObj().put("type", "null"); + i++; + match = exp.matcher(inputArr[i]); + if(match.find()) + obj.getObj().put("exp", match.group()); + else + obj.getObj().put("exp", "null"); + grocery.add(obj); + i++; + } + } + + public String makeCorrectName(String wrong){ + Pattern milk = Pattern.compile("(?i)milk"); + Matcher match = milk.matcher(wrong); + if(match.find()) + return "Milk"; + Pattern bread = Pattern.compile("(?i)bread"); + match = bread.matcher(wrong); + if(match.find()) + return "Bread"; + Pattern cookies = Pattern.compile("(?i)c..kies"); + match = cookies.matcher(wrong); + if(match.find()) + return "Cookies"; + Pattern apple = Pattern.compile("(?i)apples"); + match = apple.matcher(wrong); + if(match.find()) + return "Apples"; + return "null"; + } + + public void count(){ + int error, milk, mp1, mp2, bread, bp, cookies, cp, apples, ap1, ap2; + error = milk = mp1 = mp2 = bread = bp = cookies = cp = apples = ap1 = ap2 = 0; + for(JerksonObject i : grocery){ + if(i.getObj().containsKey("null") || i.getObj().containsValue("null")) + error++; + else { + if(i.getObj().get("name").equals("Milk")){ + milk++; + if(i.getObj().get("price").equals("3.23")) + mp1++; + else + mp2++; + } + if(i.getObj().get("name").equals("Bread")){ + bread++; + bp++; + } + if(i.getObj().get("name").equals("Cookies")){ + cookies++; + cp++; + } + if(i.getObj().get("name").equals("Apples")){ + apples++; + if(i.getObj().get("price").equals("0.25")) + ap1++; + else + ap2++; + } + } + } + printOutput(milk,mp2,mp2,bread,bp,cookies,cp,apples,ap1,ap2,error); + } + + public void printOutput(int m, int mp1, int mp2, int b, int bp, int c, int cp, int a, int ap1, int ap2,int err){ + System.out.printf("name:%9s%12s: %d times\n", "Milk", "seen", m); + System.out.printf("Price:%8s%12s: %d times\n", "3.23", "seen", mp1); + System.out.printf("Price:%8s%12s: %d times\n", "1.23", "seen", mp2); + System.out.printf("name:%9s%12s: %d times\n", "Bread", "seen", b); + System.out.printf("Price:%8s%12s: %d times\n", "1.23", "seen", bp); + System.out.printf("name:%9s%12s: %d times\n", "Cookies", "seen", c); + System.out.printf("Price:%8s%12s: %d times\n", "2.25", "seen", cp); + System.out.printf("name:%9s%12s: %d times\n", "Apples", "seen", a); + System.out.printf("Price:%8s%12s: %d times\n", "0.25", "seen", ap1); + System.out.printf("Price:%8s%12s: %d times\n", "0.23", "seen", ap2); + System.out.printf("%-16s%10s: %d times\n", "Errors", "seen", err); + } + + public void test(String[] input){ + for(String s : input){ + System.out.println(s); + } + } + + public void test2(){ + for(JerksonObject i : grocery){ + System.out.println(i.getObj().get("name")); + System.out.println(i.getObj().get("price")); + System.out.println(i.getObj().get("type")); + System.out.println(i.getObj().get("exp")); + System.out.println(); + } + } +} diff --git a/src/main/java/Main.java b/src/main/java/Main.java index 632942a..c49457a 100644 --- a/src/main/java/Main.java +++ b/src/main/java/Main.java @@ -11,7 +11,14 @@ public String readRawDataToString() throws Exception{ public static void main(String[] args) throws Exception{ String output = (new Main()).readRawDataToString(); - System.out.println(output); + JerksonParser jp = new JerksonParser(); +// jp.test(jp.getObjects(output)); +// jp.test2(); + jp.makeObjects(jp.getObjects(output)); + jp.test2(); + +// jp.makeObjects(jp.getObjects(output)); +// jp.count(); } } diff --git a/target/classes/Main.class b/target/classes/Main.class index c9d3858bc278f548c9eaabc471ed4e0ba034dcf0..7889c005edd6080dc00c38d1222c957ba72786c2 100644 GIT binary patch delta 613 zcmZXQTTfF#6otPjt*2)?ZJ}Jep|mJ+E3M$&qM`y4(?%ol!T29o%wo+vCocwO{J);jr53#+nC;Z1s5%?snR(mp1GKVMU?0 z+wa4jV6(9oDEyjjv`S6;!5W4cG2G+6N5!zp14ZhU{kU!;TZ%qK9uEzVSo3&nc*0Xf z+-VJGIj2aUnqpXILmM{98=f)pwXarHSJ#8+#k*#(6Ll1`b5%FByk}eW@^%z9TJ_5O z+y8qKV&Cot|8$8c=tL_NV%Hf}A@+ZBqznY|YoacgQbE3S+q~Imd#HDjt6jS7# zqjcJ$b8dw`-kW2RJ^X4PEyq-?SX}I3dZddzGJ~wI-TVm>f@xBcWK>)x1@n^9Wgp}y b$or?IN(uLh+$&*ZxXR3_9Exkgi81>JA1zq} delta 536 zcmZvY+e#ck5Qe{U*YwV8yKZ(p#8cui@sKzg&#sBa1BfVw2!UMAg~$e7gBcHjfcM_X zK8Xqn3W9gyjc?*3h&3~Tgx5l7eB%@_~;+a>Xx}EH%^`rY$pkGR#`$m_K`vDLKr3_xF5n(=Tm!YrlR5>svx% zdp8hjm!q5Fw)c6bSPIsHoppb!Amsle3+6{yv{_QFI|gIRK;?}>&sW-XF00=F2?U)& zV>J};G!d06doPd^O)AK0d=`mGo@;L70&?W_B;hbxRb9SKbRCAZ8TCZ{Q@V0E5z`uJ zHGi0tdel*`Y);7+G-zy8CaFr363w)Pj;gHcUZH#b3iIuP)H%-bDQ@36>A#PQ8&;8K eB%_YmsAFBs@sd}{r}ZtZ+DHEBBl-*BeC Date: Mon, 23 Mar 2020 14:38:43 -0400 Subject: [PATCH 3/7] fixed formatting. done --- src/main/java/JerksonObject.java | 4 -- src/main/java/JerksonParser.java | 61 ++++++++++++--------------- src/main/java/Main.java | 8 +--- src/test/java/JerksonParserTest.java | 43 +++++++++++++++++++ target/classes/Main.class | Bin 1217 -> 1217 bytes 5 files changed, 72 insertions(+), 44 deletions(-) create mode 100644 src/test/java/JerksonParserTest.java diff --git a/src/main/java/JerksonObject.java b/src/main/java/JerksonObject.java index 76141b4..954e050 100644 --- a/src/main/java/JerksonObject.java +++ b/src/main/java/JerksonObject.java @@ -11,8 +11,4 @@ public JerksonObject(){ public Map getObj(){ return obj; } - - public Boolean containsValue(String value){ - return obj.containsValue(value); - } } diff --git a/src/main/java/JerksonParser.java b/src/main/java/JerksonParser.java index 7648121..cb22dd0 100644 --- a/src/main/java/JerksonParser.java +++ b/src/main/java/JerksonParser.java @@ -1,16 +1,16 @@ +import java.util.ArrayList; import java.util.LinkedList; import java.util.List; import java.util.regex.Matcher; import java.util.regex.Pattern; public class JerksonParser { - private final String seperator = "##"; + private Pattern patt; - private Matcher match; List grocery; public JerksonParser(){ - grocery = new LinkedList(); + grocery = new ArrayList(); } public String[] getObjects(String input){ @@ -25,7 +25,7 @@ public void makeObjects(String[] inputArr){ Pattern exp = Pattern.compile("(?<=expiration:).*"); for(int i = 0; i < inputArr.length; i++){ JerksonObject obj = new JerksonObject(); - match = patt.matcher(inputArr[i]); + Matcher match = patt.matcher(inputArr[i]); if(match.find()) obj.getObj().put("name", makeCorrectName(match.group())); else @@ -108,36 +108,31 @@ public void count(){ } } } - printOutput(milk,mp2,mp2,bread,bp,cookies,cp,apples,ap1,ap2,error); - } - - public void printOutput(int m, int mp1, int mp2, int b, int bp, int c, int cp, int a, int ap1, int ap2,int err){ - System.out.printf("name:%9s%12s: %d times\n", "Milk", "seen", m); - System.out.printf("Price:%8s%12s: %d times\n", "3.23", "seen", mp1); - System.out.printf("Price:%8s%12s: %d times\n", "1.23", "seen", mp2); - System.out.printf("name:%9s%12s: %d times\n", "Bread", "seen", b); - System.out.printf("Price:%8s%12s: %d times\n", "1.23", "seen", bp); - System.out.printf("name:%9s%12s: %d times\n", "Cookies", "seen", c); - System.out.printf("Price:%8s%12s: %d times\n", "2.25", "seen", cp); - System.out.printf("name:%9s%12s: %d times\n", "Apples", "seen", a); - System.out.printf("Price:%8s%12s: %d times\n", "0.25", "seen", ap1); - System.out.printf("Price:%8s%12s: %d times\n", "0.23", "seen", ap2); - System.out.printf("%-16s%10s: %d times\n", "Errors", "seen", err); - } - - public void test(String[] input){ - for(String s : input){ - System.out.println(s); - } + printOutput(milk,mp1,mp2,bread,bp,cookies,cp,apples,ap1,ap2,error); } - public void test2(){ - for(JerksonObject i : grocery){ - System.out.println(i.getObj().get("name")); - System.out.println(i.getObj().get("price")); - System.out.println(i.getObj().get("type")); - System.out.println(i.getObj().get("exp")); - System.out.println(); - } + public void printOutput(int m, int mp1, int mp2, int b, int bp, + int c, int cp, int a, int ap1, int ap2,int err){ + String line = "============="; + String lin = "-------------"; + System.out.printf("name:%8s%12s: %d times\n", "Milk", "seen", m); + System.out.printf("%s%8s%s\n", line, "", line); + System.out.printf("Price:%7s%12s: %d times\n", "3.23", "seen", mp1); + System.out.printf("%s%8s%s\n", lin, "", lin); + System.out.printf("Price:%7s%12s: %d times\n\n", "1.23", "seen", mp2); + System.out.printf("name:%8s%12s: %d times\n", "Bread", "seen", b); + System.out.printf("%s%8s%s\n", line, "", line); + System.out.printf("Price:%7s%12s: %d times\n", "1.23", "seen", bp); + System.out.printf("%s%8s%s\n\n", lin, "", lin); + System.out.printf("name:%8s%12s: %d times\n", "Cookies", "seen", c); + System.out.printf("%s%8s%s\n", line, "", line); + System.out.printf("Price:%7s%12s: %d times\n", "2.25", "seen", cp); + System.out.printf("%s%8s%s\n\n", lin, "", lin); + System.out.printf("name:%8s%12s: %d times\n", "Apples", "seen", a); + System.out.printf("%s%8s%s\n", line, "", line); + System.out.printf("Price:%7s%12s: %d times\n", "0.25", "seen", ap1); + System.out.printf("%s%8s%s\n", lin, "", lin); + System.out.printf("Price:%7s%12s: %d times\n\n", "0.23", "seen", ap2); + System.out.printf("%-15s%10s: %d times\n", "Errors", "seen", err); } } diff --git a/src/main/java/Main.java b/src/main/java/Main.java index c49457a..4a4d3af 100644 --- a/src/main/java/Main.java +++ b/src/main/java/Main.java @@ -1,5 +1,4 @@ import org.apache.commons.io.IOUtils; -import java.io.IOException; public class Main { @@ -12,13 +11,8 @@ public String readRawDataToString() throws Exception{ public static void main(String[] args) throws Exception{ String output = (new Main()).readRawDataToString(); JerksonParser jp = new JerksonParser(); -// jp.test(jp.getObjects(output)); -// jp.test2(); jp.makeObjects(jp.getObjects(output)); - jp.test2(); - -// jp.makeObjects(jp.getObjects(output)); -// jp.count(); + jp.count(); } } diff --git a/src/test/java/JerksonParserTest.java b/src/test/java/JerksonParserTest.java new file mode 100644 index 0000000..5602ce6 --- /dev/null +++ b/src/test/java/JerksonParserTest.java @@ -0,0 +1,43 @@ +import org.junit.Before; +import org.junit.Test; + +import java.util.logging.Logger; + +import static org.junit.Assert.*; + +public class JerksonParserTest { + + private static final Logger log = + Logger.getLogger((JerksonParserTest.class.getName())); + JerksonParser jp; + Main main; + String output; + String[] input; + @Before + public void init() throws Exception { + main = new Main(); + jp = new JerksonParser(); + output = main.readRawDataToString(); + input = jp.getObjects(output); + jp.makeObjects(input); + + } + + @Test + public void test(){ + + for(String s : input){ + log.info(s); + } + } + + @Test + public void test2(){ + for(JerksonObject i : jp.grocery){ + log.info(i.getObj().get("name")); + log.info(i.getObj().get("price")); + log.info(i.getObj().get("type")); + log.info(i.getObj().get("exp")); + } + } +} \ No newline at end of file diff --git a/target/classes/Main.class b/target/classes/Main.class index 7889c005edd6080dc00c38d1222c957ba72786c2..b3e929a68ad8551ba12248d6aa1f8e4cf12fa8ef 100644 GIT binary patch delta 58 zcmX@ed608M0W)iIeraCGt^}cMAvr delta 58 zcmX@ed608M0W)h!YH^9t Date: Tue, 24 Mar 2020 10:23:32 -0400 Subject: [PATCH 4/7] refactored a little bit --- src/main/java/JerksonParser.java | 75 +++++++++++++++++++------------- 1 file changed, 45 insertions(+), 30 deletions(-) diff --git a/src/main/java/JerksonParser.java b/src/main/java/JerksonParser.java index cb22dd0..1b61715 100644 --- a/src/main/java/JerksonParser.java +++ b/src/main/java/JerksonParser.java @@ -6,7 +6,6 @@ public class JerksonParser { - private Pattern patt; List grocery; public JerksonParser(){ @@ -14,49 +13,65 @@ public JerksonParser(){ } public String[] getObjects(String input){ - patt = Pattern.compile("[!;%*^#@]"); + Pattern patt = Pattern.compile("[!;%*^#@]"); return patt.split(input); } public void makeObjects(String[] inputArr){ - patt = Pattern.compile("(?i)(?<=name:).*"); - Pattern price = Pattern.compile("(?i)(?<=price:).*"); - Pattern type = Pattern.compile("(?<=type:).*"); - Pattern exp = Pattern.compile("(?<=expiration:).*"); for(int i = 0; i < inputArr.length; i++){ JerksonObject obj = new JerksonObject(); - Matcher match = patt.matcher(inputArr[i]); - if(match.find()) - obj.getObj().put("name", makeCorrectName(match.group())); - else - obj.getObj().put("name", "null"); + putName(obj, inputArr[i]); i++; - match = price.matcher(inputArr[i]); - if(match.find()) { - if(!match.group().equals("")) - obj.getObj().put("price", match.group()); - else - obj.getObj().put("price", "null"); - } - else - obj.getObj().put("price", "null"); + putPrice(obj, inputArr[i]); i++; - match = type.matcher(inputArr[i]); - if(match.find()) - obj.getObj().put("type", match.group()); - else - obj.getObj().put("type", "null"); + putType(obj,inputArr[i]); i++; - match = exp.matcher(inputArr[i]); - if(match.find()) - obj.getObj().put("exp", match.group()); - else - obj.getObj().put("exp", "null"); + putExp(obj, inputArr[i]); grocery.add(obj); i++; } } + public void putName(JerksonObject obj, String keyValue){ + Pattern name = Pattern.compile("(?i)(?<=name:).*"); + Matcher match = name.matcher(keyValue); + if(match.find()) + obj.getObj().put("name", makeCorrectName(match.group())); + else + obj.getObj().put("name", "null"); + } + + public void putPrice(JerksonObject obj, String keyValue){ + Pattern price = Pattern.compile("(?i)(?<=price:).*"); + Matcher match = price.matcher(keyValue); + if(match.find()) { + if(!match.group().equals("")) + obj.getObj().put("price", match.group()); + else + obj.getObj().put("price", "null"); + } + else + obj.getObj().put("price", "null"); + } + + public void putType(JerksonObject obj, String keyValue){ + Pattern type = Pattern.compile("(?i)(?<=type:).*"); + Matcher match = type.matcher(keyValue); + if(match.find()) + obj.getObj().put("type", match.group()); + else + obj.getObj().put("type", "null"); + } + + public void putExp(JerksonObject obj, String keyValue){ + Pattern exp = Pattern.compile("(?i)(?<=expiration:).*"); + Matcher match = exp.matcher(keyValue); + if(match.find()) + obj.getObj().put("exp", match.group()); + else + obj.getObj().put("exp", "null"); + } + public String makeCorrectName(String wrong){ Pattern milk = Pattern.compile("(?i)milk"); Matcher match = milk.matcher(wrong); From 42956a932a346e6cb3505212d801f06c53479566 Mon Sep 17 00:00:00 2001 From: vle Date: Tue, 7 Apr 2020 02:43:23 -0400 Subject: [PATCH 5/7] gitignore target --- .gitignore | 137 ++++++++++++++++++++++++++++--------- target/classes/Main.class | Bin 1217 -> 0 bytes target/classes/RawData.txt | 1 - 3 files changed, 103 insertions(+), 35 deletions(-) delete mode 100644 target/classes/Main.class delete mode 100644 target/classes/RawData.txt diff --git a/.gitignore b/.gitignore index cd4e7ae..9feef6d 100644 --- a/.gitignore +++ b/.gitignore @@ -1,46 +1,115 @@ -# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio and Webstorm -# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839 +# Created by .ignore support plugin (hsz.mobi) +### Java template +# Compiled class file +*.class -# User-specific stuff: -.idea/workspace.xml -.idea/tasks.xml +# Log file +*.log -.idea/* +# BlueJ files +*.ctxt -target/* +# Mobile Tools for Java (J2ME) +.mtj.tmp/ -*.iml -# Sensitive or high-churn files: -.idea/dataSources.ids -.idea/dataSources.xml -.idea/dataSources.local.xml -.idea/sqlDataSources.xml -.idea/dynamic.xml -.idea/uiDesigner.xml +# Package Files # +*.jar +*.war +*.ear +*.zip +*.tar.gz +*.rar + +# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml +hs_err_pid* +### Eclipse template + +.metadata +bin/ +tmp/ +*.tmp +*.bak +*.swp +*~.nib +local.properties +.settings/ +.loadpath +.recommenders + +# Eclipse Core +.project + +# External tool builders +.externalToolBuilders/ + +# Locally stored "Eclipse launch configurations" +*.launch + +# PyDev specific (Python IDE for Eclipse) +*.pydevproject + +# CDT-specific (C/C++ Development Tooling) +.cproject + +# JDT-specific (Eclipse Java Development Tools) +.classpath -# Gradle: -.idea/gradle.xml -.idea/libraries +# Java annotation processor (APT) +.factorypath -# Mongo Explorer plugin: -.idea/mongoSettings.xml +# PDT-specific (PHP Development Tools) +.buildpath -## File-based project format: -*.iws +# sbteclipse plugin +.target -## Plugin-specific files: +# Tern plugin +.tern-project -# IntelliJ -/out/ +# TeXlipse plugin +.texlipse -# mpeltonen/sbt-idea plugin -.idea_modules/ +# STS (Spring Tool Suite) +.springBeans -# JIRA plugin -atlassian-ide-plugin.xml +# Code Recommenders +.recommenders/ + +# Scala IDE specific (Scala & Java development for Eclipse) +.cache-main +.scala_dependencies +.worksheet +### macOS template +*.DS_Store +.AppleDouble +.LSOverride + +# Icon must end with two \r +Icon + + +# Thumbnails +._* + +# Files that might appear in the root of a volume +.DocumentRevisions-V100 +.fseventsd +.Spotlight-V100 +.TemporaryItems +.Trashes +.VolumeIcon.icns +.com.apple.timemachine.donotpresent + +# Directories potentially created on remote AFP share +.AppleDB +.AppleDesktop +Network Trash Folder +Temporary Items +.apdisk + +#Intellij files +.idea +*.iml -# Crashlytics plugin (for Android Studio and IntelliJ) -com_crashlytics_export_strings.xml -crashlytics.properties -crashlytics-build.properties -fabric.properties +#maven build target +target/ diff --git a/target/classes/Main.class b/target/classes/Main.class deleted file mode 100644 index b3e929a68ad8551ba12248d6aa1f8e4cf12fa8ef..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1217 zcmZuwX;afs6g}ydl7^PHtSSm_v`~q-E4Uzw%M@_{nNdGI!kZFklTMNe^iQy6HL+9unPM#tg(rZm-(c|?> zQBzPX^q7B`vK-@`%`t~iDvvvE#SnF2?n%RRYBk=a5rEb|`Bs&emGn>EQb+cjM$ZSP z(O5V#YE1R=)AJFeYT`hi@ZzS^uzgJOKg#g81ES!aAj_EJ&fuzWjZYsz`N@w6@{EaA zGKxWd>mdL`80L;I9iv1A Date: Tue, 7 Apr 2020 02:45:07 -0400 Subject: [PATCH 6/7] ignore java/nio --- .gitignore | 115 -------------------- README.md | 51 --------- java/nio/file/annotations.xml | 5 - output.txt | 23 ---- pom.xml | 23 ---- src/main/java/JerksonObject.java | 14 --- src/main/java/JerksonParser.java | 153 --------------------------- src/main/java/Main.java | 18 ---- src/main/resources/RawData.txt | 1 - src/test/java/JerksonParserTest.java | 43 -------- 10 files changed, 446 deletions(-) delete mode 100644 .gitignore delete mode 100644 README.md delete mode 100644 java/nio/file/annotations.xml delete mode 100644 output.txt delete mode 100644 pom.xml delete mode 100644 src/main/java/JerksonObject.java delete mode 100644 src/main/java/JerksonParser.java delete mode 100644 src/main/java/Main.java delete mode 100644 src/main/resources/RawData.txt delete mode 100644 src/test/java/JerksonParserTest.java diff --git a/.gitignore b/.gitignore deleted file mode 100644 index 9feef6d..0000000 --- a/.gitignore +++ /dev/null @@ -1,115 +0,0 @@ -# Created by .ignore support plugin (hsz.mobi) -### Java template -# Compiled class file -*.class - -# Log file -*.log - -# BlueJ files -*.ctxt - -# Mobile Tools for Java (J2ME) -.mtj.tmp/ - -# Package Files # -*.jar -*.war -*.ear -*.zip -*.tar.gz -*.rar - -# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml -hs_err_pid* -### Eclipse template - -.metadata -bin/ -tmp/ -*.tmp -*.bak -*.swp -*~.nib -local.properties -.settings/ -.loadpath -.recommenders - -# Eclipse Core -.project - -# External tool builders -.externalToolBuilders/ - -# Locally stored "Eclipse launch configurations" -*.launch - -# PyDev specific (Python IDE for Eclipse) -*.pydevproject - -# CDT-specific (C/C++ Development Tooling) -.cproject - -# JDT-specific (Eclipse Java Development Tools) -.classpath - -# Java annotation processor (APT) -.factorypath - -# PDT-specific (PHP Development Tools) -.buildpath - -# sbteclipse plugin -.target - -# Tern plugin -.tern-project - -# TeXlipse plugin -.texlipse - -# STS (Spring Tool Suite) -.springBeans - -# Code Recommenders -.recommenders/ - -# Scala IDE specific (Scala & Java development for Eclipse) -.cache-main -.scala_dependencies -.worksheet -### macOS template -*.DS_Store -.AppleDouble -.LSOverride - -# Icon must end with two \r -Icon - - -# Thumbnails -._* - -# Files that might appear in the root of a volume -.DocumentRevisions-V100 -.fseventsd -.Spotlight-V100 -.TemporaryItems -.Trashes -.VolumeIcon.icns -.com.apple.timemachine.donotpresent - -# Directories potentially created on remote AFP share -.AppleDB -.AppleDesktop -Network Trash Folder -Temporary Items -.apdisk - -#Intellij files -.idea -*.iml - -#maven build target -target/ diff --git a/README.md b/README.md deleted file mode 100644 index 7a6d1a4..0000000 --- a/README.md +++ /dev/null @@ -1,51 +0,0 @@ -## WELCOME TO THE HURT LOCKER - -By this time you should have been introduced to Java Strings, Exceptions, Unit Testing, and Regex. - -# You will need all of these today! - -In this project you will find a file in the resource folder called RawData.txt. It was supposed to be a grocery list formated in JSON, but after a huge defeat this weekend in a game called Munchkin, Tariq your fearless yet petty leader decided to come reformat it in his own Object Notation. JerkSON... you are welcome. - -## JerkSON Format - -Just like Json , JerkSON is supposed to be a Key Value Pair data store. - -In Json Key and Value are seperated as such (Key:Value) where the colon is the seperator. - -In JerkSON Key and Value could be seperated by using a any of the following (:, @, ^, *, %) and there is no guarntee that there isn't another hidden symbol seperator. (There could be another one, or maybe there isn't , you tell me)... lol - -In Json Key and Value pairs are seperated by a ',' in JerkSON its '##' - -## Your Task -Its your job to build a JerkSON data parser, that is able to read in the raw data , and output a string formated list that resembles (outputFormat.txt) - -There are some things to look out for.... If you haven't figured it out by now Tariq has many wonderful qualities, spelling isn't one of them, so Words may not be spelled correctly. You need to decipher what Tariq was trying to spell using pattern matching. - -for example: - -In the shopping list Tariq has Cookies, but he could spell like Cookies, c00Kies, Co0kies and so on. - -YOU ARE NOT ALLOWED to use any Java based string manipulation!!!!!!!!!!!! - -You must use regex to detect the patterns and match them. - - -Oh one more thing.... Tariq is kind of petty... so you can blame STELLA and JOCELYN for this. - -Its not guranteed that every Key will have a Value, and every Value will have a pair. For instance: - -you may see something like this - -``` -Name:Milk;Price:3.23;type:;expiration:1/24/2016## -``` - -Notice how TYPE has a key but no Value.... if you try and parse this into an object your program could crash. - -You will need to handle your exceptions! - -I also expect you to report on how many exceptions you saw while parsing the data. - - -GOOD LUCK ZIPCODERS!!!! My the Odds be ever in your favor!!!! - diff --git a/java/nio/file/annotations.xml b/java/nio/file/annotations.xml deleted file mode 100644 index 58d6e8c..0000000 --- a/java/nio/file/annotations.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - - - \ No newline at end of file diff --git a/output.txt b/output.txt deleted file mode 100644 index c096375..0000000 --- a/output.txt +++ /dev/null @@ -1,23 +0,0 @@ -name: Milk seen: 6 times -============= ============= -Price: 3.23 seen: 5 times -------------- ------------- -Price: 1.23 seen: 1 time - -name: Bread seen: 6 times -============= ============= -Price: 1.23 seen: 6 times -------------- ------------- - -name: Cookies seen: 8 times -============= ============= -Price: 2.25 seen: 8 times -------------- ------------- - -name: Apples seen: 4 times -============= ============= -Price: 0.25 seen: 2 times -------------- ------------- -Price: 0.23 seen: 2 times - -Errors seen: 4 times diff --git a/pom.xml b/pom.xml deleted file mode 100644 index 39639cd..0000000 --- a/pom.xml +++ /dev/null @@ -1,23 +0,0 @@ - - - 4.0.0 - - io.zipcoder - HurtLocker - 1.0-SNAPSHOT - - - - junit - junit - 4.12 - - - org.apache.directory.studio - org.apache.commons.io - 2.4 - - - diff --git a/src/main/java/JerksonObject.java b/src/main/java/JerksonObject.java deleted file mode 100644 index 954e050..0000000 --- a/src/main/java/JerksonObject.java +++ /dev/null @@ -1,14 +0,0 @@ -import java.util.LinkedHashMap; -import java.util.Map; - -public class JerksonObject { - Map obj; - - public JerksonObject(){ - obj = new LinkedHashMap(); - } - - public Map getObj(){ - return obj; - } -} diff --git a/src/main/java/JerksonParser.java b/src/main/java/JerksonParser.java deleted file mode 100644 index 1b61715..0000000 --- a/src/main/java/JerksonParser.java +++ /dev/null @@ -1,153 +0,0 @@ -import java.util.ArrayList; -import java.util.LinkedList; -import java.util.List; -import java.util.regex.Matcher; -import java.util.regex.Pattern; - -public class JerksonParser { - - List grocery; - - public JerksonParser(){ - grocery = new ArrayList(); - } - - public String[] getObjects(String input){ - Pattern patt = Pattern.compile("[!;%*^#@]"); - return patt.split(input); - } - - public void makeObjects(String[] inputArr){ - for(int i = 0; i < inputArr.length; i++){ - JerksonObject obj = new JerksonObject(); - putName(obj, inputArr[i]); - i++; - putPrice(obj, inputArr[i]); - i++; - putType(obj,inputArr[i]); - i++; - putExp(obj, inputArr[i]); - grocery.add(obj); - i++; - } - } - - public void putName(JerksonObject obj, String keyValue){ - Pattern name = Pattern.compile("(?i)(?<=name:).*"); - Matcher match = name.matcher(keyValue); - if(match.find()) - obj.getObj().put("name", makeCorrectName(match.group())); - else - obj.getObj().put("name", "null"); - } - - public void putPrice(JerksonObject obj, String keyValue){ - Pattern price = Pattern.compile("(?i)(?<=price:).*"); - Matcher match = price.matcher(keyValue); - if(match.find()) { - if(!match.group().equals("")) - obj.getObj().put("price", match.group()); - else - obj.getObj().put("price", "null"); - } - else - obj.getObj().put("price", "null"); - } - - public void putType(JerksonObject obj, String keyValue){ - Pattern type = Pattern.compile("(?i)(?<=type:).*"); - Matcher match = type.matcher(keyValue); - if(match.find()) - obj.getObj().put("type", match.group()); - else - obj.getObj().put("type", "null"); - } - - public void putExp(JerksonObject obj, String keyValue){ - Pattern exp = Pattern.compile("(?i)(?<=expiration:).*"); - Matcher match = exp.matcher(keyValue); - if(match.find()) - obj.getObj().put("exp", match.group()); - else - obj.getObj().put("exp", "null"); - } - - public String makeCorrectName(String wrong){ - Pattern milk = Pattern.compile("(?i)milk"); - Matcher match = milk.matcher(wrong); - if(match.find()) - return "Milk"; - Pattern bread = Pattern.compile("(?i)bread"); - match = bread.matcher(wrong); - if(match.find()) - return "Bread"; - Pattern cookies = Pattern.compile("(?i)c..kies"); - match = cookies.matcher(wrong); - if(match.find()) - return "Cookies"; - Pattern apple = Pattern.compile("(?i)apples"); - match = apple.matcher(wrong); - if(match.find()) - return "Apples"; - return "null"; - } - - public void count(){ - int error, milk, mp1, mp2, bread, bp, cookies, cp, apples, ap1, ap2; - error = milk = mp1 = mp2 = bread = bp = cookies = cp = apples = ap1 = ap2 = 0; - for(JerksonObject i : grocery){ - if(i.getObj().containsKey("null") || i.getObj().containsValue("null")) - error++; - else { - if(i.getObj().get("name").equals("Milk")){ - milk++; - if(i.getObj().get("price").equals("3.23")) - mp1++; - else - mp2++; - } - if(i.getObj().get("name").equals("Bread")){ - bread++; - bp++; - } - if(i.getObj().get("name").equals("Cookies")){ - cookies++; - cp++; - } - if(i.getObj().get("name").equals("Apples")){ - apples++; - if(i.getObj().get("price").equals("0.25")) - ap1++; - else - ap2++; - } - } - } - printOutput(milk,mp1,mp2,bread,bp,cookies,cp,apples,ap1,ap2,error); - } - - public void printOutput(int m, int mp1, int mp2, int b, int bp, - int c, int cp, int a, int ap1, int ap2,int err){ - String line = "============="; - String lin = "-------------"; - System.out.printf("name:%8s%12s: %d times\n", "Milk", "seen", m); - System.out.printf("%s%8s%s\n", line, "", line); - System.out.printf("Price:%7s%12s: %d times\n", "3.23", "seen", mp1); - System.out.printf("%s%8s%s\n", lin, "", lin); - System.out.printf("Price:%7s%12s: %d times\n\n", "1.23", "seen", mp2); - System.out.printf("name:%8s%12s: %d times\n", "Bread", "seen", b); - System.out.printf("%s%8s%s\n", line, "", line); - System.out.printf("Price:%7s%12s: %d times\n", "1.23", "seen", bp); - System.out.printf("%s%8s%s\n\n", lin, "", lin); - System.out.printf("name:%8s%12s: %d times\n", "Cookies", "seen", c); - System.out.printf("%s%8s%s\n", line, "", line); - System.out.printf("Price:%7s%12s: %d times\n", "2.25", "seen", cp); - System.out.printf("%s%8s%s\n\n", lin, "", lin); - System.out.printf("name:%8s%12s: %d times\n", "Apples", "seen", a); - System.out.printf("%s%8s%s\n", line, "", line); - System.out.printf("Price:%7s%12s: %d times\n", "0.25", "seen", ap1); - System.out.printf("%s%8s%s\n", lin, "", lin); - System.out.printf("Price:%7s%12s: %d times\n\n", "0.23", "seen", ap2); - System.out.printf("%-15s%10s: %d times\n", "Errors", "seen", err); - } -} diff --git a/src/main/java/Main.java b/src/main/java/Main.java deleted file mode 100644 index 4a4d3af..0000000 --- a/src/main/java/Main.java +++ /dev/null @@ -1,18 +0,0 @@ -import org.apache.commons.io.IOUtils; - -public class Main { - - public String readRawDataToString() throws Exception{ - ClassLoader classLoader = getClass().getClassLoader(); - String result = IOUtils.toString(classLoader.getResourceAsStream("RawData.txt")); - return result; - } - - public static void main(String[] args) throws Exception{ - String output = (new Main()).readRawDataToString(); - JerksonParser jp = new JerksonParser(); - - jp.makeObjects(jp.getObjects(output)); - jp.count(); - } -} diff --git a/src/main/resources/RawData.txt b/src/main/resources/RawData.txt deleted file mode 100644 index f8c15a3..0000000 --- a/src/main/resources/RawData.txt +++ /dev/null @@ -1 +0,0 @@ -naMe:Milk;price:3.23;type:Food;expiration:1/25/2016##naME:BreaD;price:1.23;type:Food;expiration:1/02/2016##NAMe:BrEAD;price:1.23;type:Food;expiration:2/25/2016##naMe:MiLK;price:3.23;type:Food^expiration:1/11/2016##naMe:Cookies;price:2.25;type:Food%expiration:1/25/2016##naMe:CoOkieS;price:2.25;type:Food*expiration:1/25/2016##naMe:COokIes;price:2.25;type:Food;expiration:3/22/2016##naMe:COOkieS;price:2.25;type:Food;expiration:1/25/2016##NAME:MilK;price:3.23;type:Food;expiration:1/17/2016##naMe:MilK;price:1.23;type:Food!expiration:4/25/2016##naMe:apPles;price:0.25;type:Food;expiration:1/23/2016##naMe:apPles;price:0.23;type:Food;expiration:5/02/2016##NAMe:BrEAD;price:1.23;type:Food;expiration:1/25/2016##naMe:;price:3.23;type:Food;expiration:1/04/2016##naMe:Milk;price:3.23;type:Food;expiration:1/25/2016##naME:BreaD;price:1.23;type:Food@expiration:1/02/2016##NAMe:BrEAD;price:1.23;type:Food@expiration:2/25/2016##naMe:MiLK;priCe:;type:Food;expiration:1/11/2016##naMe:Cookies;price:2.25;type:Food;expiration:1/25/2016##naMe:Co0kieS;pRice:2.25;type:Food;expiration:1/25/2016##naMe:COokIes;price:2.25;type:Food;expiration:3/22/2016##naMe:COOkieS;Price:2.25;type:Food;expiration:1/25/2016##NAME:MilK;price:3.23;type:Food;expiration:1/17/2016##naMe:MilK;priCe:;type:Food;expiration:4/25/2016##naMe:apPles;prIce:0.25;type:Food;expiration:1/23/2016##naMe:apPles;pRice:0.23;type:Food;expiration:5/02/2016##NAMe:BrEAD;price:1.23;type:Food;expiration:1/25/2016##naMe:;price:3.23;type:Food^expiration:1/04/2016## \ No newline at end of file diff --git a/src/test/java/JerksonParserTest.java b/src/test/java/JerksonParserTest.java deleted file mode 100644 index 5602ce6..0000000 --- a/src/test/java/JerksonParserTest.java +++ /dev/null @@ -1,43 +0,0 @@ -import org.junit.Before; -import org.junit.Test; - -import java.util.logging.Logger; - -import static org.junit.Assert.*; - -public class JerksonParserTest { - - private static final Logger log = - Logger.getLogger((JerksonParserTest.class.getName())); - JerksonParser jp; - Main main; - String output; - String[] input; - @Before - public void init() throws Exception { - main = new Main(); - jp = new JerksonParser(); - output = main.readRawDataToString(); - input = jp.getObjects(output); - jp.makeObjects(input); - - } - - @Test - public void test(){ - - for(String s : input){ - log.info(s); - } - } - - @Test - public void test2(){ - for(JerksonObject i : jp.grocery){ - log.info(i.getObj().get("name")); - log.info(i.getObj().get("price")); - log.info(i.getObj().get("type")); - log.info(i.getObj().get("exp")); - } - } -} \ No newline at end of file From ffe577f0a3433e8a2a8255f29913a096669593f8 Mon Sep 17 00:00:00 2001 From: vle Date: Tue, 7 Apr 2020 02:45:56 -0400 Subject: [PATCH 7/7] fixed --- .gitignore | 117 +++++++++++++++++++++++++++++++++ README.md | 51 ++++++++++++++ output.txt | 23 +++++++ pom.xml | 23 +++++++ src/main/resources/RawData.txt | 1 + 5 files changed, 215 insertions(+) create mode 100644 .gitignore create mode 100644 README.md create mode 100644 output.txt create mode 100644 pom.xml create mode 100644 src/main/resources/RawData.txt diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..931affe --- /dev/null +++ b/.gitignore @@ -0,0 +1,117 @@ +# Created by .ignore support plugin (hsz.mobi) +### Java template +# Compiled class file +*.class + +# Log file +*.log + +# BlueJ files +*.ctxt + +# Mobile Tools for Java (J2ME) +.mtj.tmp/ + +# Package Files # +*.jar +*.war +*.ear +*.zip +*.tar.gz +*.rar + +# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml +hs_err_pid* +### Eclipse template + +.metadata +bin/ +tmp/ +*.tmp +*.bak +*.swp +*~.nib +local.properties +.settings/ +.loadpath +.recommenders + +# Eclipse Core +.project + +# External tool builders +.externalToolBuilders/ + +# Locally stored "Eclipse launch configurations" +*.launch + +# PyDev specific (Python IDE for Eclipse) +*.pydevproject + +# CDT-specific (C/C++ Development Tooling) +.cproject + +# JDT-specific (Eclipse Java Development Tools) +.classpath + +# Java annotation processor (APT) +.factorypath + +# PDT-specific (PHP Development Tools) +.buildpath + +# sbteclipse plugin +.target + +# Tern plugin +.tern-project + +# TeXlipse plugin +.texlipse + +# STS (Spring Tool Suite) +.springBeans + +# Code Recommenders +.recommenders/ + +# Scala IDE specific (Scala & Java development for Eclipse) +.cache-main +.scala_dependencies +.worksheet +### macOS template +*.DS_Store +.AppleDouble +.LSOverride + +# Icon must end with two \r +Icon + + +# Thumbnails +._* + +# Files that might appear in the root of a volume +.DocumentRevisions-V100 +.fseventsd +.Spotlight-V100 +.TemporaryItems +.Trashes +.VolumeIcon.icns +.com.apple.timemachine.donotpresent + +# Directories potentially created on remote AFP share +.AppleDB +.AppleDesktop +Network Trash Folder +Temporary Items +.apdisk + +#Intellij files +.idea +*.iml + +#maven build target +target/ + +java/ \ No newline at end of file diff --git a/README.md b/README.md new file mode 100644 index 0000000..7a6d1a4 --- /dev/null +++ b/README.md @@ -0,0 +1,51 @@ +## WELCOME TO THE HURT LOCKER + +By this time you should have been introduced to Java Strings, Exceptions, Unit Testing, and Regex. + +# You will need all of these today! + +In this project you will find a file in the resource folder called RawData.txt. It was supposed to be a grocery list formated in JSON, but after a huge defeat this weekend in a game called Munchkin, Tariq your fearless yet petty leader decided to come reformat it in his own Object Notation. JerkSON... you are welcome. + +## JerkSON Format + +Just like Json , JerkSON is supposed to be a Key Value Pair data store. + +In Json Key and Value are seperated as such (Key:Value) where the colon is the seperator. + +In JerkSON Key and Value could be seperated by using a any of the following (:, @, ^, *, %) and there is no guarntee that there isn't another hidden symbol seperator. (There could be another one, or maybe there isn't , you tell me)... lol + +In Json Key and Value pairs are seperated by a ',' in JerkSON its '##' + +## Your Task +Its your job to build a JerkSON data parser, that is able to read in the raw data , and output a string formated list that resembles (outputFormat.txt) + +There are some things to look out for.... If you haven't figured it out by now Tariq has many wonderful qualities, spelling isn't one of them, so Words may not be spelled correctly. You need to decipher what Tariq was trying to spell using pattern matching. + +for example: + +In the shopping list Tariq has Cookies, but he could spell like Cookies, c00Kies, Co0kies and so on. + +YOU ARE NOT ALLOWED to use any Java based string manipulation!!!!!!!!!!!! + +You must use regex to detect the patterns and match them. + + +Oh one more thing.... Tariq is kind of petty... so you can blame STELLA and JOCELYN for this. + +Its not guranteed that every Key will have a Value, and every Value will have a pair. For instance: + +you may see something like this + +``` +Name:Milk;Price:3.23;type:;expiration:1/24/2016## +``` + +Notice how TYPE has a key but no Value.... if you try and parse this into an object your program could crash. + +You will need to handle your exceptions! + +I also expect you to report on how many exceptions you saw while parsing the data. + + +GOOD LUCK ZIPCODERS!!!! My the Odds be ever in your favor!!!! + diff --git a/output.txt b/output.txt new file mode 100644 index 0000000..c096375 --- /dev/null +++ b/output.txt @@ -0,0 +1,23 @@ +name: Milk seen: 6 times +============= ============= +Price: 3.23 seen: 5 times +------------- ------------- +Price: 1.23 seen: 1 time + +name: Bread seen: 6 times +============= ============= +Price: 1.23 seen: 6 times +------------- ------------- + +name: Cookies seen: 8 times +============= ============= +Price: 2.25 seen: 8 times +------------- ------------- + +name: Apples seen: 4 times +============= ============= +Price: 0.25 seen: 2 times +------------- ------------- +Price: 0.23 seen: 2 times + +Errors seen: 4 times diff --git a/pom.xml b/pom.xml new file mode 100644 index 0000000..39639cd --- /dev/null +++ b/pom.xml @@ -0,0 +1,23 @@ + + + 4.0.0 + + io.zipcoder + HurtLocker + 1.0-SNAPSHOT + + + + junit + junit + 4.12 + + + org.apache.directory.studio + org.apache.commons.io + 2.4 + + + diff --git a/src/main/resources/RawData.txt b/src/main/resources/RawData.txt new file mode 100644 index 0000000..f8c15a3 --- /dev/null +++ b/src/main/resources/RawData.txt @@ -0,0 +1 @@ +naMe:Milk;price:3.23;type:Food;expiration:1/25/2016##naME:BreaD;price:1.23;type:Food;expiration:1/02/2016##NAMe:BrEAD;price:1.23;type:Food;expiration:2/25/2016##naMe:MiLK;price:3.23;type:Food^expiration:1/11/2016##naMe:Cookies;price:2.25;type:Food%expiration:1/25/2016##naMe:CoOkieS;price:2.25;type:Food*expiration:1/25/2016##naMe:COokIes;price:2.25;type:Food;expiration:3/22/2016##naMe:COOkieS;price:2.25;type:Food;expiration:1/25/2016##NAME:MilK;price:3.23;type:Food;expiration:1/17/2016##naMe:MilK;price:1.23;type:Food!expiration:4/25/2016##naMe:apPles;price:0.25;type:Food;expiration:1/23/2016##naMe:apPles;price:0.23;type:Food;expiration:5/02/2016##NAMe:BrEAD;price:1.23;type:Food;expiration:1/25/2016##naMe:;price:3.23;type:Food;expiration:1/04/2016##naMe:Milk;price:3.23;type:Food;expiration:1/25/2016##naME:BreaD;price:1.23;type:Food@expiration:1/02/2016##NAMe:BrEAD;price:1.23;type:Food@expiration:2/25/2016##naMe:MiLK;priCe:;type:Food;expiration:1/11/2016##naMe:Cookies;price:2.25;type:Food;expiration:1/25/2016##naMe:Co0kieS;pRice:2.25;type:Food;expiration:1/25/2016##naMe:COokIes;price:2.25;type:Food;expiration:3/22/2016##naMe:COOkieS;Price:2.25;type:Food;expiration:1/25/2016##NAME:MilK;price:3.23;type:Food;expiration:1/17/2016##naMe:MilK;priCe:;type:Food;expiration:4/25/2016##naMe:apPles;prIce:0.25;type:Food;expiration:1/23/2016##naMe:apPles;pRice:0.23;type:Food;expiration:5/02/2016##NAMe:BrEAD;price:1.23;type:Food;expiration:1/25/2016##naMe:;price:3.23;type:Food^expiration:1/04/2016## \ No newline at end of file