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

org.w3c.its.IProcessor Maven / Gradle / Ivy

/*===========================================================================
  Copyright (C) 2008-2013 by the Okapi Framework contributors
-----------------------------------------------------------------------------
  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.
===========================================================================*/

package org.w3c.its;

import java.net.URI;

import org.w3c.dom.Document;

/**
 * Provides the mathods to apply ITS rules and markup to a given document.
 */
public interface IProcessor {

	/**
	 * Flag for the Translate
	 * data category (ITS 1.0)
	 */
	long DC_TRANSLATE         = 0x00000001;
	/**
	 * Flag for the Localization Note
	 * data category (ITS 1.0, enhanced in 2.0)
	 */
	long DC_LOCNOTE           = 0x00000002;
	/**
	 * Flag for the Terminology
	 * data category (ITS 1.0, enhanced in 2.0)
	 */
	long DC_TERMINOLOGY       = 0x00000004;
	/**
	 * Flag for the Directionality
	 * data category (ITS 1.0)
	 */
	long DC_DIRECTIONALITY    = 0x00000008;
	/**
	 * Flag for the Language Information
	 * data category (ITS 1.0)
	 */
	long DC_LANGINFO          = 0x00000010;
	/**
	 * Flag for the Elements Within Text
	 * data category (ITS 1.0)
	 */
	long DC_WITHINTEXT        = 0x00000020;
	/**
	 * Flag for the Domain
	 * data category (ITS 2.0)
	 */
	long DC_DOMAIN            = 0x00000040; // ITS 2.0
	/**
	 * Flag for the Text Analysis
	 * data category (ITS 2.0)
	 */
	long DC_TEXTANALYSIS      = 0x00000080; // ITS 2.0
	/**
	 * Flag for the Locale Filter
	 * data category (ITS 2.0)
	 */
	long DC_LOCFILTER         = 0x00000100; // ITS 2.0
	/**
	 * Flag for the Provenance
	 * data category (ITS 2.0)
	 */
	long DC_PROVENANCE        = 0x00000200; // ITS 2.0
	/**
	 * Flag for the External Resource
	 * data category (ITS 2.0)
	 */
	long DC_EXTERNALRES       = 0x00000400; // ITS 2.0
	/**
	 * Flag for the Target Pointer
	 * data category (ITS 2.0)
	 */
	long DC_TARGETPOINTER     = 0x00000800; // ITS 2.0
	/**
	 * Flag for the Id Value
	 * data category (ITS 2.0)
	 */
	long DC_IDVALUE           = 0x00001000; // ITS 2.0
	/**
	 * Flag for the Preserve Space
	 * data category (ITS 2.0)
	 */
	long DC_PRESERVESPACE     = 0x00002000; // ITS 2.0
	/**
	 * Flag for the Localization Quality Issue
	 * data category (ITS 2.0)
	 */
	long DC_LOCQUALITYISSUE   = 0x00004000; // ITS 2.0
	/**
	 * Flag for the Localization Quality Rating
	 * data category (ITS 2.0)
	 */
	long DC_LOCQUALITYRATING  = 0x00008000; // ITS 2.0
	/**
	 * Flag for the MT Confidence
	 * data category (ITS 2.0)
	 */
	long DC_MTCONFIDENCE      = 0x00010000; // ITS 2.0
	/**
	 * Flag for the Allowed Characters
	 * data category (ITS 2.0)
	 */
	long DC_ALLOWEDCHARS      = 0x00020000; // ITS 2.0
	/**
	 * Flag for the Storage Size
	 * data category (ITS 2.0)
	 */
	long DC_STORAGESIZE       = 0x00040000; // ITS 2.0

	/**
	 * Flag for the Sub-Filter definition data category (Extension)
	 */
	long DC_SUBFILTER         = 0x00080000; // Extension
	/**
	 * Flag for all categories (forward compatible).
	 */
	long DC_ALL               = 0xFFFFFFFF;
	
	/**
	 * Adds a set of global rules to the document to process.
	 * 

The rules are added to the internal storage of the document, not to the document tree. *

Use this method to add one rule set or more before calling {@link #applyRules(long)}. * @param rulesDoc Document where the global rules are declared. * @param docURI URI of the document. This is needed because xlink:href need a initial location. */ void addExternalRules (Document rulesDoc, URI docURI); /** * Adds a set of global rules to the document to process. * See {@link #addExternalRules(Document, URI)} for more details. * @param docURI URI of the document that contains the rules to add. */ void addExternalRules (URI docURI); /** * Applies the current ITS rules to the document. This method decorates * the document tree with special flags that are used for getting the * different ITS information later. * @param dataCategories Flag indicating what data categories to apply. * The value must be one of the DC_* values or several combined with * a OR operator. For example: applyRules(DC_TRANSLATE | DC_LOCNOTE); *

Use DC_ALL to apply all data categories. */ void applyRules (long dataCategories); /** * Removes all the special flags added when applying the ITS rules. * Once you have called this method you should call {@link #applyRules(long)} again to be able * to use ITS-aware methods again. */ void disapplyRules (); }





© 2015 - 2025 Weber Informatics LLC | Privacy Policy