@Test
public void testSentenceBoundaryHandling() throws Exception {

	String seq = "The qu1ck br0wn fox jumps over the lazy dog";
	StringProviderMXBean provider = AbstractStringProvider.connectToServer(_host, _rmiport, _lm_id);
	String orig1 = Properties.get().getProperty("lt.lm.insertSentenceTags");
	String orig = Properties.get().getProperty("lt.lm.handleBoundaries");
	Properties.get().setProperty("lt.lm.insertSentenceTags", "0");
	Properties.get().setProperty("lt.lm.handleBoundaries", "-1");
	List<String>[] ngrams = provider.getNgrams("The");
	System.out.println(Arrays.asList(ngrams));
	Assert.assertTrue(ngrams.length == 0);
	Properties.get().setProperty("lt.lm.handleBoundaries", "0");
	ngrams = provider.getNgrams("The");
	System.out.println(Arrays.asList(ngrams));
	Assert.assertTrue(ngrams.length == 1);
	Assert.assertEquals("The", ngrams[0].get(0));
	Properties.get().setProperty("lt.lm.handleBoundaries", "1");
	ngrams = provider.getNgrams(seq);
	System.out.println(Arrays.asList(ngrams));
	Assert.assertEquals("The", ngrams[0].get(0));
	Assert.assertEquals("The", ngrams[0].get(1));
	Properties.get().setProperty("lt.lm.handleBoundaries", "2");
	ngrams = provider.getNgrams(seq);
	System.out.println(Arrays.asList(ngrams));
	Assert.assertEquals("The", ngrams[0].get(0));
	Assert.assertEquals("qu1ck", ngrams[0].get(1));
	Assert.assertTrue(ngrams[0].size() == 2);
	Assert.assertTrue(ngrams[1].size() == 3);
	
	ngrams = provider.getNgrams("^ hello world");
	System.out.println(Arrays.asList(ngrams));
	Assert.assertEquals("^", ngrams[0].get(0));
	Assert.assertEquals("hello", ngrams[0].get(1));
	Assert.assertTrue(ngrams[0].size() == 2);
	Assert.assertTrue(ngrams[1].size() == 3);
	Properties.get().setProperty("lt.lm.handleBoundaries", orig);
	Properties.get().setProperty("lt.lm.insertSentenceTags", orig1);
}