Examples of FrontCodedStringList


Examples of it.unimi.dsi.util.FrontCodedStringList

      ByteArrayOutputStream bytesOut;
      ObjectOutputStream objOut;
      byte[] bytes;

      List<String> termList = Lists.newArrayList(terms);
      FrontCodedStringList frontcodedList = new FrontCodedStringList(termList, 8, true);

      bytesOut = new ByteArrayOutputStream();
      objOut = new ObjectOutputStream(bytesOut);
      objOut.writeObject(frontcodedList);
      objOut.close();
View Full Code Here

Examples of it.unimi.dsi.util.FrontCodedStringList

    ByteArrayOutputStream bytesOut;
    ObjectOutputStream objOut;
    byte[] bytes;

    // Serialize the front-coded dictionary
    FrontCodedStringList frontcodedList = new FrontCodedStringList(stringList, 8, true);

    bytesOut = new ByteArrayOutputStream();
    objOut = new ObjectOutputStream(bytesOut);
    objOut.writeObject(frontcodedList);
    objOut.close();
View Full Code Here

Examples of it.unimi.dsi.util.FrontCodedStringList

      ByteArrayOutputStream bytesOut;
      ObjectOutputStream objOut;
      byte[] bytes;

      List<String> termList = Lists.newArrayList(terms);
      FrontCodedStringList frontcodedList = new FrontCodedStringList(termList, 8, true);

      bytesOut = new ByteArrayOutputStream();
      objOut = new ObjectOutputStream(bytesOut);
      objOut.writeObject(frontcodedList);
      objOut.close();
View Full Code Here

Examples of it.unimi.dsi.util.FrontCodedStringList

  }

  @Test
  public void test2() throws IOException {
    List<String> terms = Lists.newArrayList("apple", "bannana", "cherry", "grape", "watermelon");
    FrontCodedStringList list = new FrontCodedStringList(terms, 8, true);

    assertEquals("apple", list.get(0).toString());
    assertEquals("bannana", list.get(1).toString());
    assertEquals("cherry", list.get(2).toString());
    assertEquals("grape", list.get(3).toString());
    assertEquals("watermelon", list.get(4).toString());

    File f = new File("test.dat");
    BinIO.storeObject(list, f);
    try {
      FrontCodedStringList list2 = (FrontCodedStringList) BinIO.loadObject(f);

      assertEquals("apple", list2.get(0).toString());
      assertEquals("bannana", list2.get(1).toString());
      assertEquals("cherry", list2.get(2).toString());
      assertEquals("grape", list2.get(3).toString());
      assertEquals("watermelon", list2.get(4).toString());
    } catch (ClassNotFoundException e) {
      e.printStackTrace();
    }

    f.delete();
View Full Code Here

Examples of it.unimi.dsi.util.FrontCodedStringList

      ByteArrayOutputStream bytesOut;
      ObjectOutputStream objOut;
      byte[] bytes;

      List<String> termList = Lists.newArrayList(terms);
      FrontCodedStringList frontcodedList = new FrontCodedStringList(termList, 8, true);

      bytesOut = new ByteArrayOutputStream();
      objOut = new ObjectOutputStream(bytesOut);
      objOut.writeObject(frontcodedList);
      objOut.close();
View Full Code Here

Examples of it.unimi.dsi.util.FrontCodedStringList

  }

  @Test
  public void test2() throws IOException {
    List<String> terms = Lists.newArrayList("apple", "bannana", "cherry", "grape", "watermelon");
    FrontCodedStringList list = new FrontCodedStringList(terms, 8, true);

    assertEquals("apple", list.get(0).toString());
    assertEquals("bannana", list.get(1).toString());
    assertEquals("cherry", list.get(2).toString());
    assertEquals("grape", list.get(3).toString());
    assertEquals("watermelon", list.get(4).toString());

    File f = new File("test.dat");
    BinIO.storeObject(list, f);
    try {
      FrontCodedStringList list2 = (FrontCodedStringList) BinIO.loadObject(f);

      assertEquals("apple", list2.get(0).toString());
      assertEquals("bannana", list2.get(1).toString());
      assertEquals("cherry", list2.get(2).toString());
      assertEquals("grape", list2.get(3).toString());
      assertEquals("watermelon", list2.get(4).toString());
    } catch (ClassNotFoundException e) {
      e.printStackTrace();
    }

    f.delete();
View Full Code Here

Examples of it.unimi.dsi.util.FrontCodedStringList

      ByteArrayOutputStream bytesOut;
      ObjectOutputStream objOut;
      byte[] bytes;

      List<String> termList = Lists.newArrayList(terms);
      FrontCodedStringList frontcodedList = new FrontCodedStringList(termList, 8, true);

      bytesOut = new ByteArrayOutputStream();
      objOut = new ObjectOutputStream(bytesOut);
      objOut.writeObject(frontcodedList);
      objOut.close();
View Full Code Here

Examples of it.unimi.dsi.util.FrontCodedStringList

      ByteArrayOutputStream bytesOut;
      ObjectOutputStream objOut;
      byte[] bytes;

      List<String> termList = Lists.newArrayList(terms);
      FrontCodedStringList frontcodedList = new FrontCodedStringList(termList, 8, true);

      bytesOut = new ByteArrayOutputStream();
      objOut = new ObjectOutputStream(bytesOut);
      objOut.writeObject(frontcodedList);
      objOut.close();
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.