public String[] search(String category, int d) { logger.info("searching label " + category + " at depth " + d + "..."); //long beginTotal = System.currentTimeMillis(), beginPartial = 0, endPartial = 0; String[] result = search(category); if (d <= 0) { return result; } //Set<String> completeResult = new HashSet<String>(); //Iterator<String> it = result.iterator(); String cat = null; for (int i = 0; i < result.length; i++) { String[] s = search(result[i], d - 1); //completeResult.addAll(set); } //long endTotal = System.currentTimeMillis(); return null; }
public void search(String category, Set<WikipediaCategory> subcategories, int max) { search(new WikipediaCategory(category), subcategories, max); }
public void search(String category, Set<WikipediaCategory> subcategories, int max, Set<String> blackList) { search(new WikipediaCategory(category), subcategories, max, blackList); }
public void search(String category, Set<WikipediaCategory> subcategories) { search(new WikipediaCategory(category), subcategories); }
int pageCount = 0, totalPageCount = 0; Set<WikipediaCategory> result = new HashSet<>(); categorySubCategorySearcher.search(query, result, maxDepth); Iterator<WikipediaCategory> it = result.iterator(); int categoryCount = 0;
int label = indexSet.getIndex(s[1]); Set<WikipediaCategory> result = new HashSet<>(); categorySubCategorySearcher.search(s[0], result, maxDepth); Iterator<WikipediaCategory> it = result.iterator(); for (int i = 0; it.hasNext(); i++) {
logger.debug("searching " + line.getOptionValue("search") + "..."); Set<WikipediaCategory> result = new HashSet<>(); categorySuperCategorySearcher.search(line.getOptionValue("search"), result, maxDepth, blackList); Iterator<WikipediaCategory> it = result.iterator(); for (int i = 0; it.hasNext(); i++) { logger.debug("searching " + line.getOptionValue("search") + "..."); Set<WikipediaCategory> result = new HashSet<>(); categorySuperCategorySearcher.search(line.getOptionValue("search"), result);
public void search(WikipediaCategory category, Set<WikipediaCategory> subcategories, Set<String> blackList) { String[] categories = search(category.getLabel()); //logger.info(category.getLabel() + "\t" + categories.length); for (int i = 0; i < categories.length; i++) { if (blackList.contains(categories[i])) { continue; } String path = (category.getPath().length() == 0 ? category.getLabel() : category.getPath() + ">" + category.getLabel()); WikipediaCategory subcategory = new WikipediaCategory(categories[i], category.getDepth() + 1, path); boolean b = subcategories.add(subcategory); if (b) { search(subcategory, subcategories, blackList); } } }
public void search(WikipediaCategory category, Set<WikipediaCategory> subcategories) { String[] categories = search(category.getLabel()); //logger.info(category.getLabel() + "\t" + categories.length); for (int i = 0; i < categories.length; i++) { String path = (category.getPath().length() == 0 ? category.getLabel() : category.getPath() + ">" + category.getLabel()); WikipediaCategory subcategory = new WikipediaCategory(categories[i], category.getDepth() + 1, path); boolean b = subcategories.add(subcategory); if (b) { search(subcategory, subcategories); } } }
public void search(WikipediaCategory category, Set<WikipediaCategory> subcategories, int max) { if (category.getDepth() >= max) { subcategories.add(category); return; } String[] categories = search(category.getLabel()); //logger.debug(category + "\t" + categories.length); for (int i = 0; i < categories.length; i++) { String path = (category.getPath().length() == 0 ? category.getLabel() : category.getPath() + ">" + category.getLabel()); WikipediaCategory subcategory = new WikipediaCategory(categories[i], category.getDepth() + 1, path); boolean b = subcategories.add(subcategory); if (b) { search(subcategory, subcategories, max); } } }
public void search(WikipediaCategory category, Set<WikipediaCategory> subcategories, int max, Set<String> blackList) { //logger.debug(blackList.size() + "\t"+ category.getLabel()); //if (blackList.contains(category.getLabel())){ // logger.error("FOUND " + category.getLabel()); // return; //} if (category.getDepth() >= max) { subcategories.add(category); return; } String[] categories = search(category.getLabel()); //logger.debug(category + "\t" + categories.length); for (int i = 0; i < categories.length; i++) { if (blackList.contains(categories[i])) { continue; } String path = (category.getPath().length() == 0 ? category.getLabel() : category.getPath() + ">" + category.getLabel()); WikipediaCategory subcategory = new WikipediaCategory(categories[i], category.getDepth() + 1, path); boolean b = subcategories.add(subcategory); if (b) { search(subcategory, subcategories, max, blackList); } } }