public double prob(String word) {
        Double ret = 0.0;

        // probabilities are computed once
        if (this.probs == null) {
            probs = new HashMap<String, Double>();
            double i = 0;
            for (Connection c : connections) {
                i += transitionCounter.get(c.getTag()).getValue();
            }
            ++i;
            for (Connection c : connections) {
                probs.put(c.getTag(), (((double) transitionCounter.get(c.getTag()).getValue()) / i));
            }
            defaultProb = (1.0 / i) * (1.0 / ((double) ( maxConnections - connections.size())));
        }

        ret = probs.get(word);

        // if there isn't a probability computed for a given string, defaultProb
        // (associated with masterConnection) is given
        if (ret == null) {
            ret = defaultProb;
            
        }
        
        return ret.doubleValue();
    }