public static WordNetRelation create ( String name , String code , String reciprocal , double weight ) { Preconditions . checkArgument ( ! Strings . isNullOrEmpty ( name ) ) ; Preconditions . checkArgument ( weight >= 0 , "Weight must be >= 0" ) ; name = name . toUpperCase ( ) . trim ( ) . replaceAll ( "\\p{Z}+" , "_" ) ; if ( ! index . containsKey ( name ) ) { index . put ( name , new WordNetRelation ( name , reciprocal , weight , code ) ) ; } return index . get ( name ) ; }
Creates or gets a Metadata with the given name