diff --git a/Tagger/.project b/Tagger/.project index c2b994e..ce938e0 100644 --- a/Tagger/.project +++ b/Tagger/.project @@ -16,7 +16,7 @@ <arguments> <dictionary> <key>LaunchConfigHandle</key> - <value><project>/.externalToolBuilders/New_Builder.launch</value> + <value><project>/.externalToolBuilders/New_Builder (1).launch</value> </dictionary> </arguments> </buildCommand> diff --git a/Tagger/src/Tagger.java b/Tagger/src/Tagger.java index 82da159..38a1703 100644 --- a/Tagger/src/Tagger.java +++ b/Tagger/src/Tagger.java @@ -26,6 +26,11 @@ public class Tagger { StringBuilder sb = new StringBuilder(); if (tags!=null) { for (String tag : tags) { + if (imageTag.subtaglist.containsKey(tag)) { + List<String> subtag = imageTag.subtaglist.get(tag); + /* info needed- subtags and + * action- look up the value for the subtag */ + } if (sb.length()!=0) { sb.append("; "); } diff --git a/Tagger/src/imageTag.java b/Tagger/src/imageTag.java index 6bc50b2..d38babb 100644 --- a/Tagger/src/imageTag.java +++ b/Tagger/src/imageTag.java @@ -29,6 +29,7 @@ public class imageTag { public static List<File> pixiv_rawimage_list = new ArrayList<File>(); public static HashMap<String,List<String>> taglist = new HashMap<String,List<String>>(); public static Map<String,Integer> tagCounter = new TreeMap<String,Integer>(); + public static HashMap<String,List<String>> subtaglist = new HashMap<String,List<String>>(); public static void main(String[] args) { @@ -61,10 +62,32 @@ public class imageTag { s = br.readLine(); while (s!=null) { String newtag = s.trim().toLowerCase(); - tag_whitelist.put(newtag,true); - System.out.println("Read in whitelisted tag: "+newtag); + String[] combtag; + List<String> listofsubs = new ArrayList<String>(); + if (s.contains(": ")); { + combtag = s.split(": "); + for (int i=1;i<combtag.length; i++) { + tag_whitelist.put(combtag[i].trim().toLowerCase(),true); + System.out.println("Read in whitelisted tag: "+combtag[i]); + subtaglist.put(combtag[i],listofsubs); + } + tag_whitelist.put(combtag[0].trim().toLowerCase(),true); + System.out.println("Read in whitelisted tag: "+combtag[0]); + listofsubs.add(combtag[0]); + } + /* the first word is read and will commit to the change while other + * tags in colons will be read but default to the first for committing */ s=br.readLine(); - } + } + System.out.println("SUBTAG LIST:"); + for (String ss : subtaglist.keySet()) { + List<String> subtags = subtaglist.get(ss); + System.out.println(" "+ss+": "); + for (String sss : subtags) { + System.out.println(" -"+sss); + } + } + System.out.println("============"); } catch (IOException e) { e.printStackTrace(); }