![JAR search and dependency download from the Maven repository](/logo.png)
de.julielab.jsbd.EOSSymbols Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of jcore-jsbd-ae Show documentation
Show all versions of jcore-jsbd-ae Show documentation
UIMA Wrapper for the JULIE Sentence Boundary Detector.
/**
* EOSSymbols.java
*
* Copyright (c) 2015, JULIE Lab.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the GNU Lesser General Public License (LGPL) v3.0
*
* Author: tomanek
*
* Current version: 1.6
* Since version: 1.0
*
* Creation date: Aug 01, 2006
*
* A list of end-of-sentence symbols.
**/
package de.julielab.jsbd;
import java.util.TreeSet;
class EOSSymbols {
private TreeSet symbols;
public EOSSymbols() {
init();
}
private void init() {
symbols = new TreeSet();
symbols.add(".");
symbols.add(":");
symbols.add("!");
symbols.add("?");
symbols.add("]");
symbols.add(")");
symbols.add("\"");
}
public TreeSet getSymbols() {
return symbols;
}
public boolean contains(String c) {
return symbols.contains(c);
}
public boolean tokenEndsWithEOSSymbol(String token) {
if (token.length()>0) {
String lastChar = token.substring(token.length() - 1, token.length());
if (symbols.contains(lastChar)) {
return true;
}
}
return false;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy