File tree Expand file tree Collapse file tree 1 file changed +9
-4
lines changed
src/edu/stanford/nlp/semgraph/semgrex Expand file tree Collapse file tree 1 file changed +9
-4
lines changed Original file line number Diff line number Diff line change 1
1
package edu .stanford .nlp .semgraph .semgrex ;
2
2
3
3
import edu .stanford .nlp .stats .IntCounter ;
4
- import edu .stanford .nlp .util .Generics ;
5
4
5
+ import java .util .HashMap ;
6
6
import java .util .Map ;
7
7
8
8
/** a class that takes care of the stuff necessary for variable strings.
12
12
* @author Roger Levy (rog@nlp.stanford.edu)
13
13
*/
14
14
class VariableStrings {
15
- private Map <Object , String > varsToStrings ;
16
- private IntCounter <Object > numVarsSet ;
15
+ private final Map <Object , String > varsToStrings ;
16
+ private final IntCounter <Object > numVarsSet ;
17
17
18
18
public VariableStrings () {
19
- varsToStrings = Generics . newHashMap ();
19
+ varsToStrings = new HashMap <> ();
20
20
numVarsSet = new IntCounter <>();
21
21
}
22
22
23
+ public VariableStrings (VariableStrings other ) {
24
+ varsToStrings = new HashMap <>(other .varsToStrings );
25
+ numVarsSet = new IntCounter <>(other .numVarsSet );
26
+ }
27
+
23
28
public boolean isSet (Object o ) {
24
29
return numVarsSet .getCount (o ) == 1 ;
25
30
}
You can’t perform that action at this time.
0 commit comments