Examples of normalize()


Examples of edu.stanford.nlp.sempre.fbalignment.lexicons.normalizers.PrepDropNormalizer.normalize()

public class PrepDropNormalizerTest {
 
  @Test
  public void normalization() {
    PrepDropNormalizer normalizer = new PrepDropNormalizer();
    assertEquals("interested",normalizer.normalize("interested in"));
    assertEquals("interested", normalizer.normalize("interested at"));
    assertEquals("blow up",normalizer.normalize("blow up in"));
    assertEquals("blow up the",normalizer.normalize("blow up the to"));
  }
}
View Full Code Here

Examples of edu.umd.cloud9.util.map.HMapID.normalize()

    m1.put(2, 1.9);
    m1.put(3, 3.0);

    assertEquals(m1.length(), 4.2308393, 10E-6);

    m1.normalize();

    assertEquals(m1.get(1), 0.5436274, 10E-6);
    assertEquals(m1.get(2), 0.44908348, 10E-6);
    assertEquals(m1.get(3), 0.70907915, 10E-6);
    assertEquals(m1.length(), 1, 10E-6);
View Full Code Here

Examples of edu.umd.cloud9.util.map.HMapIF.normalize()

    m1.put(2, 1.9f);
    m1.put(3, 3.0f);

    assertEquals(m1.length(), 4.2308393, 10E-6);

    m1.normalize();

    assertEquals(m1.get(1), 0.5436274, 10E-6);
    assertEquals(m1.get(2), 0.44908348, 10E-6);
    assertEquals(m1.get(3), 0.70907915, 10E-6);
    assertEquals(m1.length(), 1, 10E-6);
View Full Code Here

Examples of edu.umd.hooka.alignment.hmm.ATable.normalize()

            int cond_values = 1;
            if (!hac.isHMMHomogeneous()) {
              cond_values = 100;
            }
            ATable at = new ATable(hac.isHMMHomogeneous(),
                cond_values, 100); at.normalize(); at.write(dos);
                //      System.out.println(at);
                dos.close()
          }
        }
        conf.setOutputKeyClass(IntWritable.class);
View Full Code Here

Examples of edu.umd.hooka.ttables.TTable_monolithic.normalize()

    TTable_monolithic tc = (TTable_monolithic)tt.clone(); tc.clear();
    ATable ac = (ATable)at.clone(); ac.clear();
    hmm.addPartialTranslationCountsToTTable(tc);
    hmm.addPartialJumpCountsToATable(ac);
    System.out.println("COUNTS:\n" + tc);
    tc.normalize();
    ac.normalize();
    System.out.println("OLD:\n" + at);
    System.out.println("NEW:\n" + ac);
    System.out.println("\nnew:\n"+tc);
    //if (true) return;
View Full Code Here

Examples of engine.base.Vector3.normalize()

    return OutputType.SCALAR;
  }
 
  private final Vector4 _function(float du, float dv) {
    Vector3 n = new Vector3(du*strength.get(), dv*strength.get(), 1.0f);
    n.normalize();
   
    Vector4 c = new Vector4(n.x * 0.5f + 0.5f, n.y * 0.5f + 0.5f, n.z * 0.5f + 0.5f, 1.0f);
    return c;
  }
 
View Full Code Here

Examples of general.datastructures.Vector2f.normalize()

    vec3.add(vec1);
    assertEquals(10, vec3.x(),0.0001);
    assertEquals(14, vec3.y(),0.0001);
   
    Vector2f vec4 = new Vector2f(4,0);
    vec4.normalize();
    assertEquals(1, vec4.length(), 0.0001);
    vec4.scale(3f);
    assertEquals(3, vec4.length(), 0.0001)
  }
 
View Full Code Here

Examples of info.aduna.net.ParsedURI.normalize()

   * for resolving relative URIs.
   */
  protected void setBaseURI(String uriSpec) {
    // Store normalized base URI
    ParsedURI baseURI = new ParsedURI(uriSpec);
    baseURI.normalize();
    setBaseURI(baseURI);
  }

  /**
   * Sets the base URI for resolving relative URIs.
View Full Code Here

Examples of java.net.URI.normalize()

    }

  private static String normalize(String path) {
    try {
      URI uri =  new URI(path);
      String normalized = uri.normalize().toString();
      return normalized;
    } catch (URISyntaxException e) {
      e.printStackTrace();
      return null;
    }
View Full Code Here

Examples of java.nio.file.Path.normalize()

    Path file = Paths.get(location);
    if (!file.isAbsolute())
      file = file.toAbsolutePath();
    if (Files.isReadable(file)) {
      try {
        url = file.normalize().toUri().toURL();
      } catch (MalformedURLException e) {
      }
    }
    return url;
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.