public static void clear(){
  long lock_stamp=lock.writeLock();
  try {
    idToString=new ArrayList<>();
    stringToId=new HashMap<>();
    idToString.add(UNKNOWN_ID,UNKNOWN_WORD);
    stringToId.put(UNKNOWN_WORD,UNKNOWN_ID);
  }
  finally {
    lock.unlockWrite(lock_stamp);
  }
}

public static void clear ( ) { long lock_stamp = lock . writeLock ( ) ; try { idToString = new ArrayList < > ( ) ; stringToId = new HashMap < > ( ) ; idToString . add ( UNKNOWN_ID , UNKNOWN_WORD ) ; stringToId . put ( UNKNOWN_WORD , UNKNOWN_ID ) ; } finally { lock . unlockWrite ( lock_stamp ) ; } }
clears the vocabulary and initializes it with an unknown word . registered language models are left unchanged .
