Toggle navigation
Home
org.apdplat.word.util.GenericTrie<java.lang.Integer> to org.apdplat.word.util.DoubleArrayGenericTrie
No. of Instances - 2
No. of Commits - 2
No. of Projects - {'word'}
Hierarchy/Composition: -
Primitive Info: -
NameSpace: Internal -> Internal
Mapping:
Rename Variable
GENERIC_TRIE
to
DOUBLE_ARRAY_GENERIC_TRIE
GENERIC_TRIE
to
DOUBLE_ARRAY_GENERIC_TRIE
GENERIC_TRIE
to
DOUBLE_ARRAY_GENERIC_TRIE
GENERIC_TRIE
to
DOUBLE_ARRAY_GENERIC_TRIE
GENERIC_TRIE
to
DOUBLE_ARRAY_GENERIC_TRIE
GENERIC_TRIE
to
DOUBLE_ARRAY_GENERIC_TRIE
Add or Remove Method invocation
addLine(line)
to
addLine(line,map)
GENERIC_TRIE.remove(attr[0])
to
addLine(line,map)
count
to
map.size()
addLine(line)
to
addLine(line,map)
GENERIC_TRIE.remove(attr[0])
to
addLine(line,map)
count
to
map.size()
Update Anonymous class
{ @Override public void clear(){ GENERIC_TRIE.clear(); } @Override public void load( List<String> lines){ LOGGER.info("初始化bigram"); int count=0; for ( String line : lines) { try { addLine(line); count++; } catch ( Exception e) { LOGGER.error("错误的bigram数据:" + line); } } LOGGER.info("bigram初始化完毕,bigram数据条数:" + count); } @Override public void add( String line){ try { addLine(line); } catch ( Exception e) { LOGGER.error("错误的bigram数据:" + line); } } private void addLine( String line){ String[] attr=line.split("\\s+"); int frequency=Integer.parseInt(attr[1]); if (frequency > maxFrequency) { maxFrequency=frequency; } GENERIC_TRIE.put(attr[0],frequency); } @Override public void remove( String line){ try { String[] attr=line.split("\\s+"); GENERIC_TRIE.remove(attr[0]); } catch ( Exception e) { LOGGER.error("错误的bigram数据:" + line); } } }
to
{ @Override public void clear(){ DOUBLE_ARRAY_GENERIC_TRIE.clear(); } @Override public void load( List<String> lines){ LOGGER.info("初始化bigram"); Map<String,Integer> map=new HashMap<>(); for ( String line : lines) { try { addLine(line,map); } catch ( Exception e) { LOGGER.error("错误的bigram数据:" + line); } } DOUBLE_ARRAY_GENERIC_TRIE.putAll(map); LOGGER.info("bigram初始化完毕,bigram数据条数:" + map.size()); } @Override public void add( String line){ throw new RuntimeException("not yet support menthod!"); } private void addLine( String line, Map<String,Integer> map){ String[] attr=line.split("\\s+"); int frequency=Integer.parseInt(attr[1]); if (frequency > maxFrequency) { maxFrequency=frequency; } map.put(attr[0],frequency); } @Override public void remove( String line){ throw new RuntimeException("not yet support menthod!"); } }
{ @Override public void clear(){ GENERIC_TRIE.clear(); } @Override public void load( List<String> lines){ LOGGER.info("初始化trigram"); int count=0; for ( String line : lines) { try { addLine(line); count++; } catch ( Exception e) { LOGGER.error("错误的trigram数据:" + line); } } LOGGER.info("trigram初始化完毕,trigram数据条数:" + count); } @Override public void add( String line){ try { addLine(line); } catch ( Exception e) { LOGGER.error("错误的trigram数据:" + line); } } private void addLine( String line){ String[] attr=line.split("\\s+"); int frequency=Integer.parseInt(attr[1]); if (frequency > maxFrequency) { maxFrequency=frequency; } GENERIC_TRIE.put(attr[0],frequency); } @Override public void remove( String line){ try { String[] attr=line.split("\\s+"); GENERIC_TRIE.remove(attr[0]); } catch ( Exception e) { LOGGER.error("错误的trigram数据:" + line); } } }
to
{ @Override public void clear(){ DOUBLE_ARRAY_GENERIC_TRIE.clear(); } @Override public void load( List<String> lines){ LOGGER.info("初始化trigram"); Map<String,Integer> map=new HashMap<>(); for ( String line : lines) { try { addLine(line,map); } catch ( Exception e) { LOGGER.error("错误的trigram数据:" + line); } } DOUBLE_ARRAY_GENERIC_TRIE.putAll(map); LOGGER.info("trigram初始化完毕,trigram数据条数:" + map.size()); } @Override public void add( String line){ throw new RuntimeException("not yet support menthod!"); } private void addLine( String line, Map<String,Integer> map){ String[] attr=line.split("\\s+"); int frequency=Integer.parseInt(attr[1]); if (frequency > maxFrequency) { maxFrequency=frequency; } map.put(attr[0],frequency); } @Override public void remove( String line){ throw new RuntimeException("not yet support menthod!"); } }