/*******************************************************************************
 * Copyright 2016 Stephan Druskat
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 *
 * Contributors:
 *     Stephan Druskat - initial API and implementation
 *******************************************************************************/
package org.corpus_tools.atomic.extensions.processingcomponents.impl;

import java.util.List;

import org.corpus_tools.atomic.extensions.ProcessingComponentConfiguration;
import org.corpus_tools.atomic.extensions.processingcomponents.Tokenizer;
import de.hu_berlin.german.korpling.saltnpepper.salt.saltCommon.sCorpusStructure.SDocument;

/**
 * Wraps the tokenizer included in Salt ({@link de.hu_berlin.german.korpling.saltnpepper.salt.saltCommon.sDocumentStructure.tokenizer.Tokenizer})
 * in a processing component of type {@link Tokenizer}. 
 * Only works with the simplest of tokenize methods without 
 * arguments, i.e., checks against the included default 
 * abbreviation sets for English, German, Italian and French.
 * <p>
 * A customizable version of this tokenizer is implemented in {@link org.corpus_tools.atomic.extensions.processingcomponents.impl.SaltTokenizer}
 * This class is meant to be used with Salt version 2.1.1.
 * 
 * <p>
 * @see <a href="https://github.com/korpling/salt/releases/tag/salt-2.1.1">Salt version 2.1.1</a>
 * @see <a href="http://corpus-tools.org/salt">http://corpus-tools.org/salt</a>
 *
 * @author Stephan Druskat <mail@sdruskat.net>
 *
 */
public class SimpleSaltTokenizer extends Tokenizer {

	public static final String UID = "de.hu_berlin.german.korpling.saltnpepper.salt.saltCommon.sDocumentStructure.tokenizer.Tokenizer.simple";

	/* 
	 * @copydoc @see org.corpus_tools.atomic.extensions.processingcomponents.Tokenizer#tokenize(java.lang.String)
	 */
	@Override
	public List<String> tokenize(String rawSourceText) {
		// Not implemented because the wrapped tokenizer works on instances of the Salt model itself per default.
		return null;
	}
	
	/* 
	 * @copydoc @see org.corpus_tools.atomic.extensions.processingcomponents.Tokenizer#processDocument(de.hu_berlin.german.korpling.saltnpepper.salt.saltCommon.sCorpusStructure.SDocument)
	 */
	@Override
	public void processDocument(SDocument document) {
		document.getSDocumentGraph().tokenize();
	}

	/* 
	 * @copydoc @see org.corpus_tools.atomic.extensions.ProcessingComponent#getConfiguration()
	 */
	@Override
	public ProcessingComponentConfiguration<SimpleSaltTokenizer> getConfiguration() {
		return null;
	}

}

@@ -1072,100 +1072,8 @@
 zer;
-%0Aimport de.hu_berlin.german.korpling.saltnpepper.salt.saltCommon.sCorpusStructure.SDocument;
 %0A%0A/*
@@ -2301,239 +2301,124 @@
 %7B%0A%09%09
-// Not implemented because the wrapped tokenizer works on instances of the Salt model itself per default.%0A%09%09return null;%0A%09%7D%0A%09%0A%09/* %0A%09 * @copydoc @see org.corpus_tools.atomic.extensions.processingcomponents.Tokenizer#processDocument(
+de.hu_berlin.german.korpling.saltnpepper.salt.saltCommon.sDocumentStructure.tokenizer.Tokenizer saltTokenizer = new 
 de.h
@@ -2475,14 +2475,16 @@
 on.s
-Corpus
+Document
 Stru
@@ -2493,132 +2493,97 @@
 ure.
-SDocument)%0A%09 */%0A%09@Override%0A%09public void processDocument(SDocument document) %7B%0A%09%09document.getSDocumentGraph().tokenize(
+tokenizer.Tokenizer();%0A%09%09return saltTokenizer.tokenizeToString(rawSourceText, null
 );%0A%09%7D%0A
+%09
 %0A%09/*

Refactor SimpleSaltTokenizer to use the #tokenizeToString() method