Package com.jpetrak.gate.stringannotation.extendedgazetteer2.trie1

Examples of com.jpetrak.gate.stringannotation.extendedgazetteer2.trie1.CharMapState


    assertEquals(1,i);
  }

  @Test
  public void testStoreStates1() {
    StoreArrayOfCharArrays backing = new StoreArrayOfCharArrays();
    StoreStates store = new StoreStates(backing);
    store.test();
    // creating a StoreStates object also creates the initial state, so the first
    // index must be 5
    int s1 = store.newCharMapState();
View Full Code Here


  }
 

  @Test
  public void testStoreCharMapPhase1() {
    StoreCharMapPhase1 store = new StoreCharMapPhase1(new StoreArrayOfCharArrays());
    System.out.println("Adding first:1");
    int i = store.put(-1, 'a', 1);
    assertEquals(0,i);
    System.out.println("Adding first:2");
    i = store.put(0,'b', 2);
    assertEquals(0,i);
    System.out.println("Adding second");
    i = store.put(-1,'a',3);
    assertEquals(1,i);
  }
View Full Code Here

  }

  @Test
  public void testStoreStates1() {
    StoreArrayOfCharArrays backing = new StoreArrayOfCharArrays();
    StoreStates store = new StoreStates(backing);
    store.test();
    // creating a StoreStates object also creates the initial state, so the first
    // index must be 5
    int s1 = store.newCharMapState();
    assertEquals(5,s1);
    // also the initial state must have index 0
    assertEquals(0,store.initialState);
    int s2 = store.newCharMapState();
    assertEquals(10,s2);
    int s3 = store.newSingleCharState();
    assertEquals(15,s3);
    assertEquals(true,store.getIsCharMapState(s1));
    assertEquals(true,store.getIsCharMapState(s2));
    assertEquals(false,store.getIsCharMapState(s3));
    store.setLookupIndex(s1, 123);
    store.setLookupIndex(s2, 234);
    store.setLookupIndex(s3, 345);
    assertEquals(true,store.getIsCharMapState(s1));
    assertEquals(true,store.getIsCharMapState(s2));
    assertEquals(false,store.getIsCharMapState(s3));
    assertEquals(123,store.getLookupIndex(s1));
    assertEquals(234,store.getLookupIndex(s2));
    assertEquals(345,store.getLookupIndex(s3));
    assertEquals(-1,store.getCharMapIndex(s1));
    assertEquals(-1,store.getCharMapIndex(s2));
    assertEquals(0,store.getSingleCharStateChar(s3));
    store.put(store.initialState, 'a', s1);
    store.put(store.initialState, 'b', s2);
    store.put(store.initialState, 'c', s3);
    assertEquals(s1,store.next(store.initialState, 'a'));
    assertEquals(s2,store.next(store.initialState, 'b'));
    assertEquals(s3,store.next(store.initialState, 'c'));
  }
View Full Code Here

TOP

Related Classes of com.jpetrak.gate.stringannotation.extendedgazetteer2.trie1.CharMapState

Copyright © 2018 www.massapicom. 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.