<?xml version="1.0" encoding="UTF-8"?>
<!-- Licensed Materials - Property of IBM

     IBM SPSS Products: Text Analytics

     (C) Copyright IBM Corp. 2003, 2011

     US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP
     Schedule Contract with IBM Corp.  -->
<Extension version="1.0" debug="false">
  <ExtensionDetails id="Text_Link_Analysis" label="Text Link Analysis" version="1.0" provider="SPSS Inc." providerTag="SPSS" copyright="(c) 2006 SPSS Inc." description="SPSS Text Link Analysis" />
  <Resources>
    <HelpInfo id="help" type="native" path="/com.ibm.spss.ta.help/"/>
    <Bundle id="translations.tla" type="properties" path="messages"/>
    <SharedLibrary id="TextLinkAnalysisModel" path="spss.TMWBServer/bin/TextLinkAnalysis" />
	<JarFile id="commons-beanutils" path="../spss.TMWBClient/lib/commons-beanutils.jar"/>
    <JarFile id="commons-betwixt-0.7" path="../spss.TMWBClient/lib/commons-betwixt-0.7.jar"/> 
    <JarFile id="commons-digester-1.7" path="../spss.TMWBClient/lib/commons-digester-1.7.jar"/>
	
    <JarFile id="stafs" path="../spss.TMWBClient/STAS.jar"/>
   <JarFile id="TableLayout-bin-jdk1.5-2009-08-26" path="../spss.TMWBClient/lib/TableLayout-bin-jdk1.5-2009-08-26.jar"/>
   <JarFile id="tmwb" path="../spss.TMWBClient/lib/tmwb.jar"/>
	<!--Use sqlite.jar file from jre JarFile id="sqlite" path="../spss.TMWBClient/lib/sqlite.jar"/-->
  
    <JarFile id="dbUtilLib" path="../spss.TMWBClient/lib/dbUtilLib.jar"/>

  </Resources>
  <Node id="textlinkanalysis" type="dataTransformer" customPalette="text_mining" relativePosition="before" relativeTo="fileviewer" label="Text Link Analysis" labelKey="tlanode.LABEL" helpLink="textmining/tmfc/tmfc_tla_node_intro.htm" description="Analyzes and discovers text links in a collection of text data" descriptionKey="tlanode_tooltip.LABEL">
    <Properties>
      <!-- =========== debug information =========== -->
      <Property name="debug_on" valueType="boolean" defaultValue="false"/>

      <!-- =========== Field name localisation =========== -->    
      <Property name="concept1_field"     valueType="string" defaultValueKey="concept1Field.LABEL" />
      <Property name="type1_field"        valueType="string" defaultValueKey="type1Field.LABEL" />
      <Property name="concept2_field"     valueType="string" defaultValueKey="concept2Field.LABEL" />
      <Property name="type2_field"        valueType="string" defaultValueKey="type2Field.LABEL" />
      <Property name="concept3_field"     valueType="string" defaultValueKey="concept3Field.LABEL" />
      <Property name="type3_field"        valueType="string" defaultValueKey="type3Field.LABEL" />
      <Property name="concept4_field"     valueType="string" defaultValueKey="concept4Field.LABEL" />
      <Property name="type4_field"        valueType="string" defaultValueKey="type4Field.LABEL" />
      <Property name="concept5_field"     valueType="string" defaultValueKey="concept5Field.LABEL" />
      <Property name="type5_field"        valueType="string" defaultValueKey="type5Field.LABEL" />
      <Property name="concept6_field"     valueType="string" defaultValueKey="concept6Field.LABEL" />
      <Property name="type6_field"        valueType="string" defaultValueKey="type6Field.LABEL" />

      <Property name="rule_number_field"  valueType="string" defaultValueKey="ruleNumberField.LABEL" />
      <Property name="doc_id_field"       valueType="string" defaultValueKey="docIdField.LABEL" />
      <Property name="matched_text_field" valueType="string" defaultValueKey="matchedTextField.LABEL" />

      <!-- =========== fields tab =========== -->
      <Property name="id_field" valueType="string" />
      <Property name="text_field" valueType="string" />
      <Property name="method" valueType="enum">
      <Enumeration>
          <Enum value="ReadText" label="Actual text" labelKey="method.ReadText.LABEL" />
          <Enum value="ReadPath" label="Pathnames to documents" labelKey="method.ReadPath.LABEL" />
        </Enumeration>
      </Property>
      <Property name="doc_type" valueType="enum">
        <Enumeration>
          <Enum value="0" label="Full Text" labelKey="docType.Full.LABEL" />
          <Enum value="1" label="Structured Text" labelKey="docType.Structured.LABEL" />
          <Enum value="2" label="XML" labelKey="docType.XML.LABEL" />
        </Enumeration>
      </Property>
      <Property name="unity" valueType="enum">
        <Enumeration>
          <Enum value="1" label="Document mode" labelKey="unity.Document.LABEL" />
          <Enum value="0" label="Paragraph mode" labelKey="unity.Paragraph.LABEL" />
        </Enumeration>
      </Property>
      <Property name="para_min" valueType="integer" min="1" />
      <Property name="para_max" valueType="integer" min="1" defaultValue="300" />
      <Property name="encoding" valueType="enum">
        <Enumeration>
          <Enum value="auto" label="Automatic" labelKey="encoding.automatic.LABEL" />
          <Enum value="utf-8" label="UTF-8" labelKey="encoding.utf8.LABEL" />
          <Enum value="utf-16" label="UTF-16" labelKey="encoding.utf16.LABEL" />
          <Enum value="iso-8859-1" label="ISO-8859-1" labelKey="encoding.iso8859-1.LABEL" />
 		  <Enum value="iso-8859-2" label="ISO-8859-2" labelKey="encoding.iso8859-2.LABEL" />
		  <Enum value="windows-1250" label="WINDOWS-1250" labelKey="encoding.windows-1250.LABEL" />
          <Enum value="us-ascii" label="US ascii" labelKey="encoding.ascii.LABEL" />
          <Enum value="cp850" label="CP850" labelKey="encoding.cp850.LABEL" />
          <Enum value="shift-jis" label="Shift-JIS" labelKey="encoding.shiftjis.LABEL" />
          <Enum value="euc-jp" label="EUC-JP" labelKey="encoding.eucjp.LABEL" />
          <Enum value="iso2022-jp" label="ISO-2022-JP" labelKey="encoding.iso2022jp.LABEL" />
        </Enumeration>
      </Property>
      <Property name="language"  valueType="string" defaultValue="en" />
      <Property name="template_name" valueType="string"/>
      <Property name="template_language" valueType="string"/>
      <Property name="template_data" valueType="string"/>
      <Property name="template_project" valueType="string"/>
      <Property name="template_loaded_timestamp" valueType="string"/>
 <!-- =========== document settings tab =========== -->
      <Property name="mtag" valueType="string" />
      <Property name="mclef" valueType="string" />
      
      <!-- =========== Model tab =========== -->
	<Property name="optimise_speed" valueType="boolean" defaultValue="true" label="Optimise for speed of scoring" labelKey="optimise_speed.LABEL"/>

      <!-- =========== Expert tab =========== -->

      <Property name="concept_count_limit" valueType="integer" min="1" label="Concept count limit" labelKey="concept_count_limit.LABEL"/>
      <Property name="fix_punctuation" valueType="boolean" defaultValue="true" label="Accommodate punctuation errors" labelKey="fix_punctuation.LABEL"/>
      <Property name="fix_spelling" valueType="boolean" defaultValue="false" label="Accommodate spelling for a minimum root character limit of" labelKey="fix_spelling.LABEL"/>
      <Property name="spelling_limit" valueType="integer" min="0" defaultValue="5" label="Spelling limit" labelKey="spelling_limit.LABEL"/>
      <Property name="extract_uniterm" valueType="boolean" defaultValue="true" label="Extract uniterms" labelKey="extract_uniterm.LABEL"/>
      <Property name="extract_nonlinguistic" valueType="boolean" defaultValue="true" label="Extract non-linguistic entities" labelKey="extract_nonlinguistic.LABEL"/>
      <Property name="upper_case" valueType="boolean" defaultValue="true" label="Upper-case algorithm" labelKey="upper_case.LABEL"/>
      <Property name="group_names" valueType="boolean" defaultValue="false" label="Group partial and full person names together when possible" labelKey="group_names.LABEL"/>
      <Property name="permutation" valueType="integer" min="0" defaultValue="3" label="Maximum non-function word permutation" labelKey="permutation.LABEL"/>
      <Property name="jp_algorithm" valueType="integer" min="0" defaultValue="0" label="uncover concepts and patterns through sentiments" labelKey="jp_algorithm_sense.LABEL"/>
      <Property name="jp_algorithm_sense_mode" valueType="integer" min="0" defaultValue="1" label="sentiment mode to apply" labelKey="jp_algorithm_sense_mode.LABEL"/>
    </Properties>
    <!-- Text Mining Node interface -->
    <UserInterface actionHandler="com.spss.tmwb.buildnode.actions.Actions">
      <Icons>
        <Icon type="smallNode" imagePath="sm_tla.gif" />
        <Icon type="standardNode" imagePath="lg_tla.gif" />
      </Icons>
      <Tabs>
      
		
        <Tab label="Fields" labelKey="fieldTab.LABEL" helpLink="textmining/tmfc/tmfc_tla_node_fields.htm">
          <PropertiesPanel>
            <SingleFieldChooserControl property="id_field" label="ID field" labelKey="id_field.LABEL" />
            <SingleFieldChooserControl property="text_field" label="Text field" labelKey="text_field.LABEL" />
            <RadioButtonGroupControl property="method" label="Text field represents" rows="1" labelKey="text_field_represents.LABEL">
              <!--
                            <Layout gridColumn="0" gridWidth="2"/>
                            -->
            </RadioButtonGroupControl>
            <ComboBoxControl property="doc_type" label="Document type" labelKey="doc_type.LABEL">
              <Layout rowIncrement="0" gridWidth="1" />
              <Enabled>
                <Condition control="method" op="equals" value="ReadPath" />
              </Enabled>
            </ComboBoxControl>
            <PropertiesSubPanel buttonLabel="Settings..." buttonLabelKey="AdditionalSettings.LABEL" helpLink="textmining/tmfc/textmining_fields_docsettings.htm" dialogTitle="Text Mining: Document Settings" dialogTitleKey="DocumentSettingsDialog.LABEL">
              <Enabled>
                <And>
                  <Condition control="method" op="equals" value="ReadPath" />
                  <Or>
                    <Condition control="doc_type" op="equals" value="1" />
                    <Condition control="doc_type" op="equals" value="2" />
                  </Or>
                </And>
              </Enabled>
              <Layout gridColumn="3" gridWidth="1" />
              <TextAreaControl property="mclef" columns="25" label="Structured Text Formatting" labelKey="mclef.LABEL" labelAbove="true">
                <Enabled>
                  <Condition control="doc_type" op="equals" value="1" />
                </Enabled>
              </TextAreaControl>
              <TextAreaControl property="mtag" label="XML Text Formatting" labelKey="mtag.LABEL" labelAbove="true">
                <Enabled>
                  <Condition control="doc_type" op="equals" value="2" />
                </Enabled>
              </TextAreaControl>
            </PropertiesSubPanel>
            <ComboBoxControl property="unity" label="Textual unity" labelKey="unity.LABEL">
              <Enabled>
                <Condition control="method" op="equals" value="ReadPath" />
              </Enabled>
            </ComboBoxControl>
            <StaticText text="Paragraph mode settings" textKey="paragraph_mode.LABEL">
              <Layout gridColumn="1" gridWidth="1" />
              <Enabled>
                <And>
                  <Condition control="method" op="equals" value="ReadPath" />
                  <Condition control="unity" op="equals" value="0" />
                </And>
              </Enabled>
            </StaticText>
            <PropertiesPanel>
              <Layout gridColumn="1" gridWidth="1" />
              <SpinnerControl property="para_min" label="Minimum" labelKey="para_min.LABEL">
                <Layout rowIncrement="0" gridColumn="0" gridWidth="1" />
                <Enabled>
                  <And>
                    <Condition control="method" op="equals" value="ReadPath" />
                    <Condition control="unity" op="equals" value="0" />
                  </And>
                </Enabled>
              </SpinnerControl>
              <SpinnerControl property="para_max" label="Maximum" labelKey="para_max.LABEL">
                <Layout gridColumn="2" gridWidth="1" />
                <Enabled>
                  <And>
                    <Condition control="method" op="equals" value="ReadPath" />
                    <Condition control="unity" op="equals" value="0" />
                  </And>
                </Enabled>
              </SpinnerControl>
            </PropertiesPanel>
            <ComboBoxControl property="encoding" label="Input encoding" labelKey="encoding.LABEL">
              <Enabled>
                <Condition control="method" op="equals" value="ReadPath" />
              </Enabled>
            </ComboBoxControl>
            <PropertiesPanel>
		<ExtensionObjectPanel id="panelTLAResources" panelClass="com.spss.tmwb.buildnode.panels.TLAResourcesPanel"/>
            </PropertiesPanel>
          </PropertiesPanel>
        </Tab>
        
        <!-- Model tab -->
	<Tab label="Model" labelKey="modelTab.LABEL" helpLink="textmining/tmfc/tmfc_tla_node_model.htm"> <!-- points to Expert tab help -->
		<ExtensionObjectPanel id="modelPanel" panelClass="com.spss.tmwb.buildnode.panels.TLAModelPanel"/>
	</Tab>
	
        <Tab label="Expert" labelKey="expertTAB.LABEL" helpLink="textmining/tmfc/tmfc_tla_node_expert.htm">
            <ExtensionObjectPanel id="expertPanel" panelClass="com.spss.tmwb.buildnode.panels.ExpertPanel"/>
        </Tab>
        
      </Tabs>
    </UserInterface>
    <Execution>
      <Module libraryId="TextLinkAnalysisModel" name="" aslFunctionProvider="com.spss.tmwb.tlanode.actions.TLAAslFunctionProvider">
        <StatusCodes>
          <StatusCode code="0" status="error" message="Initialization Error" messageKey="initError.LABEL"/>
          <StatusCode code="1" status="error" message="Internal Error" messageKey="internalError.LABEL"/>
          <StatusCode code="2" status="error" message="No field name seleced for ID Field" messageKey="noIDFieldError.LABEL"/>
          <StatusCode code="3" status="error" message="No field name seleced for Text Field" messageKey="noTextFieldError.LABEL"/>
          <StatusCode code="4" status="error" message="Invalid Metadata" messageKey="invalidMetadataError.LABEL"/>
          <StatusCode code="5" status="error" message="Invalid input field type" messageKey="invalidInputFieldTypeError.LABEL"/>
          <StatusCode code="6" status="error" message="Failed to read the ptnmatcher.txt file" messageKey="ptnMatcherOpenError.LABEL"/>
          <StatusCode code="7" status="error" message="Invalid ptnmatcher.txt file" messageKey="invalidPtnMatcherError.LABEL"/>
          <StatusCode code="8" status="error" message="No TLA patterns found in template" messageKey="noTLAInTemplateError.LABEL"/>
          <StatusCode code="9" status="error" message="Invalid Text field name" messageKey="invalidTextFieldNameError.LABEL"/>
          <StatusCode code="10" status="error" message="Invalid ID field name" messageKey="invalidIDFieldNameError.LABEL"/>
          <StatusCode code="11" status="error" message="Missing Resource template" messageKey="missingTemplateError.LABEL"/>
          <StatusCode code="12" status="error" message="No values for 'Structured Text Formatting' defined" messageKey="noStructuredTextFormattingError.LABEL"/>
          <StatusCode code="13" status="error" message="No values for 'XML Text Formatting' defined" messageKey="noXMLTextFormattingError.LABEL"/>
          <StatusCode code="14" status="error" message="Missing or invalid Text Analytics for IBM SPSS Modeler Premium license" messageKey="missingTMFCLicenseError.LABEL"/>
          <StatusCode code="15" status="error" message="No valid license was found for the language selected in the node. This product must be licensed for each language you intend to use" messageKey="missingLanguageLicenseError.LABEL"/>
          <StatusCode code="16" status="success" message="Processed {0} rows" messageKey="processedNumberRows.LABEL"/>
        </StatusCodes>
      </Module>
    </Execution>
    <!-- This tells Clementine that the node's output data model is based on these fields added -->
    <OutputDataModel mode="replace" method="sharedLibrary" libraryId="TextLinkAnalysisModel">
    </OutputDataModel>
  </Node>
</Extension>
