try (InputStream is = FileLocator.getAsStream(sdModelPath)){
logger.info("Sentence detector model file: " + sdModelPath);
sdmodel = new SentenceModel(is);
EndOfSentenceScannerImpl eoss = new EndOfSentenceScannerImpl();
DefaultSDContextGenerator cg = new DefaultSDContextGenerator(eoss.getEndOfSentenceCharacters());
sentenceDetector = new SentenceDetectorCtakes(
sdmodel.getMaxentModel(), cg, eoss);
skipSegmentsSet = new HashSet<>();
if(skipSegmentsArray != null){
Collections.addAll(skipSegmentsSet, skipSegmentsArray);