All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.daisy.pipeline.tts.SSMLMarkSplitter Maven / Gradle / Ivy

The newest version!
package org.daisy.pipeline.tts;

import java.util.Collection;

import net.sf.saxon.s9api.XdmNode;

public interface SSMLMarkSplitter {

	/**
	 * @return a list of SSML chunks, XML document or otherwise.
	 */
	Collection split(XdmNode xdmNode);

	static class Chunk {
		public Chunk(XdmNode ssml) {
			this.ssml = ssml;
		}

		/**
		 * @param ssml the piece of SSML, XML document or otherwise.
		 * @param leftmark can be null if there is mark on the left of the chunk
		 */
		public Chunk(XdmNode ssml, String leftmark) {
			this.ssml = ssml;
			this.leftmark = leftmark;
		}

		public boolean mostLeftChunk() {
			return leftmark == null;
		}

		/**
		 * @return null if there is no mark on the left of the Chunk
		 */
		public String leftMark() {
			return leftmark;
		}

		public XdmNode ssml() {
			return ssml;
		}

		private String leftmark;
		private XdmNode ssml;

		@Override
		public String toString() {
			return "Chunk{" + leftmark + "}";
		}
	}

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy