From 91b9d3c22cf023aaba3ae663dde2e877ed0d88d6 Mon Sep 17 00:00:00 2001 From: alexb Date: Tue, 25 Feb 2020 03:58:16 -0500 Subject: [PATCH] designing tag grouping for the whitelist part 1 (blame trimead) --- Tagger/.project | 2 +- Tagger/src/Tagger.java | 5 +++++ Tagger/src/imageTag.java | 29 ++++++++++++++++++++++++++--- 3 files changed, 32 insertions(+), 4 deletions(-) diff --git a/Tagger/.project b/Tagger/.project index c2b994e..ce938e0 100644 --- a/Tagger/.project +++ b/Tagger/.project @@ -16,7 +16,7 @@ LaunchConfigHandle - <project>/.externalToolBuilders/New_Builder.launch + <project>/.externalToolBuilders/New_Builder (1).launch 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 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 pixiv_rawimage_list = new ArrayList(); public static HashMap> taglist = new HashMap>(); public static Map tagCounter = new TreeMap(); + public static HashMap> subtaglist = new HashMap>(); 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 listofsubs = new ArrayList(); + if (s.contains(": ")); { + combtag = s.split(": "); + for (int i=1;i subtags = subtaglist.get(ss); + System.out.println(" "+ss+": "); + for (String sss : subtags) { + System.out.println(" -"+sss); + } + } + System.out.println("============"); } catch (IOException e) { e.printStackTrace(); }