ConnectorSet.java :  » Natural-Language-Processing » MorphAdorner » net » sf » jlinkgrammar » Java Open Source

Java Open Source » Natural Language Processing » MorphAdorner 
MorphAdorner » net » sf » jlinkgrammar » ConnectorSet.java
package net.sf.jlinkgrammar;

/**
 * TODO add javadoc
 *
 */
public class ConnectorSet {
    Connector hash_table[];
    int table_size;
    int is_defined; /* if 0 then there is no such set */

    int connector_set_hash(String s, int d) {
        /* This hash function only looks at the leading upper case letters of
           the string, and the direction, '+' or '-'.
        */
        int i = d;
        for (int j=0; j < s.length() && Character.isUpperCase(s.charAt(j)); j++)
            i = i + (i << 1) + MyRandom.randtable[(s.charAt(j) + i) & (GlobalBean.RTSIZE - 1)];
        return (i & (table_size - 1));
    }

}
java2s.com  | Contact Us | Privacy Policy
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.