public Dictionary() { dict = new THashSet<String>(); } /**
private void initHashSet() { for (int i = 0; i < word.size(); i++) { THashSet<String> hashset = new THashSet<String>(); hashlist.add(hashset); } }
private void initclusterResult(int size) { for (int i = 0; i < size; i++) { ArrayList<String> list = new ArrayList<String>(); list.add(word.get(i)); clusterResult.add(list); THashSet<String> thashset = new THashSet<String>(); thashset.addAll(hashlist.get(i)); clusterHashList.add(thashset); } }
public static void BMES2DICT(String file, String dicfile) throws UnsupportedEncodingException, FileNotFoundException, IOException { BufferedReader bfr = new BufferedReader(new InputStreamReader(new FileInputStream(file),"utf8")); String line = null; int count=0; THashSet<String> dict = new THashSet<String>(); StringBuilder sb = new StringBuilder(); while ((line = bfr.readLine()) != null) { if(line.length()==0) continue; String[] toks = line.split("\\s+"); String label = toks[1]; String w = toks[0]; if(w.equals(" ")){//空格特殊处理 if(sb.length()>0){ dict.add(sb.toString()); sb = new StringBuilder(); } continue; } sb.append(w); if (label.equals("E") || label.equals("S")) { dict.add(sb.toString()); sb = new StringBuilder(); } } MyCollection.write(dict,dicfile); } THashSet<String> set = new THashSet<String>();
THashSet<String> dict = new THashSet<String>(); BufferedReader bfr; try {
public THashSet<String> getNewWords(String s) throws IOException { if(s.length()==0) return null; THashSet<String> newset = new THashSet<String>(); HashMap<String,Float> map = new HashMap<String, Float>(); String q = genQuery(s);
int update(String[] toks) throws IOException { if(toks==null) return 0; THashSet<String> newdict = new THashSet<String>(); String nowords = ""; int count = 0;
/** * Constructs a new {@code RComponent} instance. * * @param guid * the guid. */ public RComponent(String guid) { super(guid); actionHardReferences = new THashSet<>(); }
/** * Constructor * * @param initialCapacity * @param loadFactor */ public THashSet(int initialCapacity, float loadFactor) { this(new gnu.trove.set.hash.THashSet<>(initialCapacity, loadFactor)); }
/** * Constructs a new {@code RComponent} instance. Only used for * serialization support. */ public RComponent() { // For serialization support actionHardReferences = new THashSet<>(); }
/** * Constructor * * @param initialCapacity */ public THashSet(int initialCapacity) { this(new gnu.trove.set.hash.THashSet<>(initialCapacity)); }
/** * Constructor * * @param initialCapacity */ public THashSet(int initialCapacity) { this(new gnu.trove.set.hash.THashSet<>(initialCapacity)); }
protected final Set<Category> categories = new THashSet<>();
/** * Constructor * * @param initialCapacity * @param loadFactor */ public THashSet(int initialCapacity, float loadFactor) { this(new gnu.trove.set.hash.THashSet<>(initialCapacity, loadFactor)); }
@Override public Set<Node> getAllNodes() { Set<Node> ns = new THashSet<>( nodeState[OFFLINE_STATE].size() + nodeState[ONLINE_STATE].size() ); ns.addAll(nodeState[OFFLINE_STATE]); ns.addAll(nodeState[ONLINE_STATE]); return ns; }
private void registerService(Class<?> serviceContract, IComponentService service) { if (serviceDelegates == null) { serviceDelegates = new THashMap<>(1, 1.0f); serviceContracts = new THashSet<>(1); } serviceContracts.add(serviceContract); Method[] contractServices = serviceContract.getMethods(); for (Method serviceMethod : contractServices) { serviceDelegates.put(serviceMethod.getName(), service); } }
@Override public void setInputTrees(Tree... inputTrees) { super.setInputTrees(inputTrees); pairs = new THashSet<>(inputTrees.length * (inputTrees.length-1)/2); } }
@Override public Set<VM> getRunningVMs(Collection<Node> ns) { Set<VM> vms = new THashSet<>(); for (Node n : ns) { vms.addAll(getRunningVMs(n)); } return vms; }
@Override public Set<VM> getAllVMs() { if (all == null) { all = new THashSet<>(); for (Node n : scope) { all.addAll(parent.getRunningVMs(n)); all.addAll(parent.getSleepingVMs(n)); } all.addAll(ready); } return all; }
THashSet<String> getLeafLabels(Tree tree1) { THashSet<String> taxonSet = new THashSet<>(tree1.vertexCount()); for (TreeNode taxon : tree1.getRoot().depthFirstIterator()) { if (taxon.isLeaf()) { taxonSet.add(taxon.getLabel()); } } return taxonSet; }