• 如果您觉得本站非常有看点,那么赶紧使用Ctrl+D 收藏吧

Java FuzzyMatchMeta类的典型用法和代码示例

java 1次浏览

本文整理汇总了Java中org.pentaho.di.trans.steps.fuzzymatch.FuzzyMatchMeta的典型用法代码示例。如果您正苦于以下问题:Java FuzzyMatchMeta类的具体用法?Java FuzzyMatchMeta怎么用?Java FuzzyMatchMeta使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。

FuzzyMatchMeta类属于org.pentaho.di.trans.steps.fuzzymatch包,在下文中一共展示了FuzzyMatchMeta类的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: activegetCloserValue

点赞 3

import org.pentaho.di.trans.steps.fuzzymatch.FuzzyMatchMeta; //导入依赖的package包/类
private void activegetCloserValue()
{
 boolean enableRange=(FuzzyMatchMeta.getAlgorithmTypeByDesc(wAlgorithm.getText())==FuzzyMatchMeta.OPERATION_TYPE_LEVENSHTEIN
		 || FuzzyMatchMeta.getAlgorithmTypeByDesc(wAlgorithm.getText())==FuzzyMatchMeta.OPERATION_TYPE_NEEDLEMAN_WUNSH
		 || FuzzyMatchMeta.getAlgorithmTypeByDesc(wAlgorithm.getText())==FuzzyMatchMeta.OPERATION_TYPE_DAMERAU_LEVENSHTEIN
		 || FuzzyMatchMeta.getAlgorithmTypeByDesc(wAlgorithm.getText())==FuzzyMatchMeta.OPERATION_TYPE_JARO
		 || FuzzyMatchMeta.getAlgorithmTypeByDesc(wAlgorithm.getText())==FuzzyMatchMeta.OPERATION_TYPE_JARO_WINKLER
		 || FuzzyMatchMeta.getAlgorithmTypeByDesc(wAlgorithm.getText())==FuzzyMatchMeta.OPERATION_TYPE_PAIR_SIMILARITY)
 	&& !wgetCloserValue.getSelection();

 wlseparator.setEnabled(enableRange);
 wseparator.setEnabled(enableRange);
 wlvalueField.setEnabled(wgetCloserValue.getSelection());
 wvalueField.setEnabled(wgetCloserValue.getSelection());

 activeAddFields();
}
 

开发者ID:yintaoxue,
项目名称:read-open-source-code,
代码行数:18,
代码来源:FuzzyMatchDialog.java

示例2: activegetCloserValue

点赞 3

import org.pentaho.di.trans.steps.fuzzymatch.FuzzyMatchMeta; //导入依赖的package包/类
private void activegetCloserValue() {
  boolean enableRange =
    ( FuzzyMatchMeta.getAlgorithmTypeByDesc( wAlgorithm.getText() )
        == FuzzyMatchMeta.OPERATION_TYPE_LEVENSHTEIN
      || FuzzyMatchMeta.getAlgorithmTypeByDesc( wAlgorithm.getText() )
        == FuzzyMatchMeta.OPERATION_TYPE_NEEDLEMAN_WUNSH
      || FuzzyMatchMeta.getAlgorithmTypeByDesc( wAlgorithm.getText() )
        == FuzzyMatchMeta.OPERATION_TYPE_DAMERAU_LEVENSHTEIN
      || FuzzyMatchMeta.getAlgorithmTypeByDesc( wAlgorithm.getText() )
        == FuzzyMatchMeta.OPERATION_TYPE_JARO
      || FuzzyMatchMeta.getAlgorithmTypeByDesc( wAlgorithm.getText() )
        == FuzzyMatchMeta.OPERATION_TYPE_JARO_WINKLER || FuzzyMatchMeta
      .getAlgorithmTypeByDesc( wAlgorithm.getText() ) == FuzzyMatchMeta.OPERATION_TYPE_PAIR_SIMILARITY )
      && !wgetCloserValue.getSelection();

  wlseparator.setEnabled( enableRange );
  wseparator.setEnabled( enableRange );
  wlvalueField.setEnabled( wgetCloserValue.getSelection() );
  wvalueField.setEnabled( wgetCloserValue.getSelection() );

  activeAddFields();
}
 

开发者ID:pentaho,
项目名称:pentaho-kettle,
代码行数:23,
代码来源:FuzzyMatchDialog.java

示例3: activeAddFields

点赞 3

import org.pentaho.di.trans.steps.fuzzymatch.FuzzyMatchMeta; //导入依赖的package包/类
private void activeAddFields() {
  boolean activate =
    wgetCloserValue.getSelection()
      || ( FuzzyMatchMeta.getAlgorithmTypeByDesc( wAlgorithm.getText() )
        == FuzzyMatchMeta.OPERATION_TYPE_DOUBLE_METAPHONE )
      || ( FuzzyMatchMeta.getAlgorithmTypeByDesc( wAlgorithm.getText() )
        == FuzzyMatchMeta.OPERATION_TYPE_SOUNDEX )
      || ( FuzzyMatchMeta.getAlgorithmTypeByDesc( wAlgorithm.getText() )
        == FuzzyMatchMeta.OPERATION_TYPE_REFINED_SOUNDEX )
      || ( FuzzyMatchMeta.getAlgorithmTypeByDesc( wAlgorithm.getText() )
        == FuzzyMatchMeta.OPERATION_TYPE_METAPHONE );

  wlReturn.setEnabled( activate );
  wReturn.setEnabled( activate );
  wGetLU.setEnabled( activate );
}
 

开发者ID:pentaho,
项目名称:pentaho-kettle,
代码行数:17,
代码来源:FuzzyMatchDialog.java

示例4: getData

点赞 2

import org.pentaho.di.trans.steps.fuzzymatch.FuzzyMatchMeta; //导入依赖的package包/类
/**
 * Copy information from the meta-data input to the dialog fields.
 */ 
public void getData()
{
	if(isDebug()) logDebug( BaseMessages.getString(PKG, "FuzzyMatchDialog.Log.GettingKeyInfo")); //$NON-NLS-1$
	
	wAlgorithm.setText(FuzzyMatchMeta.getAlgorithmTypeDesc(input.getAlgorithmType()));

	if(input.getMainStreamField()!=null) wMainStreamField.setText(input.getMainStreamField());
	if(input.getLookupField()!=null) wLookupField.setText(input.getLookupField());
	wcaseSensitive.setSelection(input.isCaseSensitive());
	wgetCloserValue.setSelection(input.isGetCloserValue());
	if(input.getMinimalValue()!=null) wminValue.setText(input.getMinimalValue());
	if(input.getMaximalValue()!=null) wmaxValue.setText(input.getMaximalValue());
	if(input.getOutputMatchField()!=null) wmatchField.setText(input.getOutputMatchField());
	if(input.getOutputValueField()!=null) wvalueField.setText(input.getOutputValueField());
	if(input.getSeparator()!=null) wseparator.setText(input.getSeparator());
	
	if (input.getValue()!=null)
		for (int i=0;i<input.getValue().length;i++)
		{
			TableItem item = wReturn.table.getItem(i);
			if (input.getValue()[i]!=null     ) item.setText(1, input.getValue()[i]);
			if (input.getValueName()[i]!=null && !input.getValueName()[i].equals(input.getValue()[i]))
				item.setText(2, input.getValueName()[i]);
		}
	
	
	StreamInterface infoStream = input.getStepIOMeta().getInfoStreams().get(0);
	wStep.setText( Const.NVL(infoStream.getStepname(), "") );
	
	wStepname.selectAll();
	wReturn.setRowNums();
	wReturn.optWidth(true);
}
 

开发者ID:yintaoxue,
项目名称:read-open-source-code,
代码行数:37,
代码来源:FuzzyMatchDialog.java

示例5: activeAddFields

点赞 2

import org.pentaho.di.trans.steps.fuzzymatch.FuzzyMatchMeta; //导入依赖的package包/类
private void activeAddFields()
{
 boolean activate = wgetCloserValue.getSelection() || 
 (FuzzyMatchMeta.getAlgorithmTypeByDesc(wAlgorithm.getText())==FuzzyMatchMeta.OPERATION_TYPE_DOUBLE_METAPHONE)
  ||(FuzzyMatchMeta.getAlgorithmTypeByDesc(wAlgorithm.getText())==FuzzyMatchMeta.OPERATION_TYPE_SOUNDEX)
  ||(FuzzyMatchMeta.getAlgorithmTypeByDesc(wAlgorithm.getText())==FuzzyMatchMeta.OPERATION_TYPE_REFINED_SOUNDEX)
  ||(FuzzyMatchMeta.getAlgorithmTypeByDesc(wAlgorithm.getText())==FuzzyMatchMeta.OPERATION_TYPE_METAPHONE);
 
 wlReturn.setEnabled(activate);
 wReturn.setEnabled(activate);
 wGetLU.setEnabled(activate);
}
 

开发者ID:yintaoxue,
项目名称:read-open-source-code,
代码行数:13,
代码来源:FuzzyMatchDialog.java

示例6: activeAlgorithm

点赞 2

import org.pentaho.di.trans.steps.fuzzymatch.FuzzyMatchMeta; //导入依赖的package包/类
private void activeAlgorithm()
{
	 boolean enable=(FuzzyMatchMeta.getAlgorithmTypeByDesc(wAlgorithm.getText())==FuzzyMatchMeta.OPERATION_TYPE_LEVENSHTEIN
			 || FuzzyMatchMeta.getAlgorithmTypeByDesc(wAlgorithm.getText())==FuzzyMatchMeta.OPERATION_TYPE_NEEDLEMAN_WUNSH
			 || FuzzyMatchMeta.getAlgorithmTypeByDesc(wAlgorithm.getText())==FuzzyMatchMeta.OPERATION_TYPE_DAMERAU_LEVENSHTEIN
			 || FuzzyMatchMeta.getAlgorithmTypeByDesc(wAlgorithm.getText())==FuzzyMatchMeta.OPERATION_TYPE_JARO
			 || FuzzyMatchMeta.getAlgorithmTypeByDesc(wAlgorithm.getText())==FuzzyMatchMeta.OPERATION_TYPE_JARO_WINKLER
			 || FuzzyMatchMeta.getAlgorithmTypeByDesc(wAlgorithm.getText())==FuzzyMatchMeta.OPERATION_TYPE_PAIR_SIMILARITY);

	 wlgetCloserValue.setEnabled(enable);
	 wgetCloserValue.setEnabled(enable);
	 wlminValue.setEnabled(enable);
	 wminValue.setEnabled(enable);
	 wlmaxValue.setEnabled(enable);
	 wmaxValue.setEnabled(enable);
	 
	if( FuzzyMatchMeta.getAlgorithmTypeByDesc(wAlgorithm.getText())==FuzzyMatchMeta.OPERATION_TYPE_JARO
	 || FuzzyMatchMeta.getAlgorithmTypeByDesc(wAlgorithm.getText())==FuzzyMatchMeta.OPERATION_TYPE_JARO_WINKLER
	 || FuzzyMatchMeta.getAlgorithmTypeByDesc(wAlgorithm.getText())==FuzzyMatchMeta.OPERATION_TYPE_PAIR_SIMILARITY) {
		 if(Const.toDouble(transMeta.environmentSubstitute(wminValue.getText()), 0)>1) {
			 	wminValue.setText(String.valueOf(1));
		 }
		 if(Const.toDouble(transMeta.environmentSubstitute(wmaxValue.getText()), 0)>1) {
			 	wmaxValue.setText(String.valueOf(1));
		 }
	}
 
	 
	 boolean enableCaseSensitive =(FuzzyMatchMeta.getAlgorithmTypeByDesc(wAlgorithm.getText())==FuzzyMatchMeta.OPERATION_TYPE_LEVENSHTEIN
			 || FuzzyMatchMeta.getAlgorithmTypeByDesc(wAlgorithm.getText())==FuzzyMatchMeta.OPERATION_TYPE_DAMERAU_LEVENSHTEIN);
	 wlcaseSensitive.setEnabled(enableCaseSensitive);
	 wcaseSensitive.setEnabled(enableCaseSensitive);
	 activegetCloserValue();
}
 

开发者ID:yintaoxue,
项目名称:read-open-source-code,
代码行数:35,
代码来源:FuzzyMatchDialog.java

示例7: FuzzyMatchDialog

点赞 2

import org.pentaho.di.trans.steps.fuzzymatch.FuzzyMatchMeta; //导入依赖的package包/类
public FuzzyMatchDialog(Shell parent, Object in, TransMeta transMeta, String sname)
{
	super(parent, (BaseStepMeta)in, transMeta, sname);
	input=(FuzzyMatchMeta)in;
}
 

开发者ID:yintaoxue,
项目名称:read-open-source-code,
代码行数:6,
代码来源:FuzzyMatchDialog.java

示例8: ok

点赞 2

import org.pentaho.di.trans.steps.fuzzymatch.FuzzyMatchMeta; //导入依赖的package包/类
private void ok()
{
	if (Const.isEmpty(wStepname.getText())) return;

	input.setMainStreamField(wMainStreamField.getText());
	input.setLookupField(wLookupField.getText());
	
	input.setAlgorithmType(FuzzyMatchMeta.getAlgorithmTypeByDesc(wAlgorithm.getText()));
	input.setCaseSensitive(wcaseSensitive.getSelection());
	input.setGetCloserValue(wgetCloserValue.getSelection());
	input.setMaximalValue(wmaxValue.getText());
	input.setMinimalValue(wminValue.getText());
	
	input.setOutputMatchField(wmatchField.getText());
	input.setOutputValueField(wvalueField.getText());
	input.setSeparator(wseparator.getText());
	
	
	int nrvalues           = wReturn.nrNonEmpty();
	input.allocate(nrvalues);
	if(isDebug()) logDebug(BaseMessages.getString(PKG, "FuzzyMatchDialog.Log.FoundFields",nrvalues+"")); //$NON-NLS-1$ //$NON-NLS-2$
	for (int i=0;i<nrvalues;i++)
	{
		TableItem item        = wReturn.getNonEmpty(i);
		input.getValue()[i]        = item.getText(1);
		input.getValueName()[i]    = item.getText(2);
		if (input.getValueName()[i]==null || input.getValueName()[i].length()==0)
			input.getValueName()[i] = input.getValue()[i];
	}
	
	StreamInterface infoStream = input.getStepIOMeta().getInfoStreams().get(0);
	infoStream.setStepMeta( transMeta.findStep( wStep.getText() ) );
	if (infoStream.getStepMeta()==null)
	{
		MessageBox mb = new MessageBox(shell, SWT.OK | SWT.ICON_ERROR );
		if(Const.isEmpty(wStep.getText()))
			mb.setMessage(BaseMessages.getString(PKG, "FuzzyMatchDialog.NotStepSpecified.DialogMessage",wStep.getText())); 
		else
			mb.setMessage(BaseMessages.getString(PKG, "FuzzyMatchDialog.StepCanNotFound.DialogMessage",wStep.getText())); //$NON-NLS-1$ //$NON-NLS-2$
			
		mb.setText(BaseMessages.getString(PKG, "FuzzyMatchDialog.StepCanNotFound.DialogTitle")); //$NON-NLS-1$
		mb.open(); 
	}
	
	stepname = wStepname.getText(); // return value
	
	dispose();
}
 

开发者ID:yintaoxue,
项目名称:read-open-source-code,
代码行数:49,
代码来源:FuzzyMatchDialog.java

示例9: FuzzyMatchDialog

点赞 2

import org.pentaho.di.trans.steps.fuzzymatch.FuzzyMatchMeta; //导入依赖的package包/类
public FuzzyMatchDialog( Shell parent, Object in, TransMeta transMeta, String sname ) {
  super( parent, (BaseStepMeta) in, transMeta, sname );
  input = (FuzzyMatchMeta) in;
}
 

开发者ID:pentaho,
项目名称:pentaho-kettle,
代码行数:5,
代码来源:FuzzyMatchDialog.java

示例10: getData

点赞 2

import org.pentaho.di.trans.steps.fuzzymatch.FuzzyMatchMeta; //导入依赖的package包/类
/**
 * Copy information from the meta-data input to the dialog fields.
 */
public void getData() {
  if ( isDebug() ) {
    logDebug( BaseMessages.getString( PKG, "FuzzyMatchDialog.Log.GettingKeyInfo" ) );
  }

  wAlgorithm.setText( FuzzyMatchMeta.getAlgorithmTypeDesc( input.getAlgorithmType() ) );

  if ( input.getMainStreamField() != null ) {
    wMainStreamField.setText( input.getMainStreamField() );
  }
  if ( input.getLookupField() != null ) {
    wLookupField.setText( input.getLookupField() );
  }
  wcaseSensitive.setSelection( input.isCaseSensitive() );
  wgetCloserValue.setSelection( input.isGetCloserValue() );
  if ( input.getMinimalValue() != null ) {
    wminValue.setText( input.getMinimalValue() );
  }
  if ( input.getMaximalValue() != null ) {
    wmaxValue.setText( input.getMaximalValue() );
  }
  if ( input.getOutputMatchField() != null ) {
    wmatchField.setText( input.getOutputMatchField() );
  }
  if ( input.getOutputValueField() != null ) {
    wvalueField.setText( input.getOutputValueField() );
  }
  if ( input.getSeparator() != null ) {
    wseparator.setText( input.getSeparator() );
  }

  if ( input.getValue() != null ) {
    for ( int i = 0; i < input.getValue().length; i++ ) {
      TableItem item = wReturn.table.getItem( i );
      if ( input.getValue()[i] != null ) {
        item.setText( 1, input.getValue()[i] );
      }
      if ( input.getValueName()[i] != null && !input.getValueName()[i].equals( input.getValue()[i] ) ) {
        item.setText( 2, input.getValueName()[i] );
      }
    }
  }

  StreamInterface infoStream = input.getStepIOMeta().getInfoStreams().get( 0 );
  wStep.setText( Const.NVL( infoStream.getStepname(), "" ) );

  wReturn.setRowNums();
  wReturn.optWidth( true );

  wStepname.selectAll();
  wStepname.setFocus();
}
 

开发者ID:pentaho,
项目名称:pentaho-kettle,
代码行数:56,
代码来源:FuzzyMatchDialog.java

示例11: ok

点赞 2

import org.pentaho.di.trans.steps.fuzzymatch.FuzzyMatchMeta; //导入依赖的package包/类
private void ok() {
  if ( Utils.isEmpty( wStepname.getText() ) ) {
    return;
  }

  input.setMainStreamField( wMainStreamField.getText() );
  input.setLookupField( wLookupField.getText() );

  input.setAlgorithmType( FuzzyMatchMeta.getAlgorithmTypeByDesc( wAlgorithm.getText() ) );
  input.setCaseSensitive( wcaseSensitive.getSelection() );
  input.setGetCloserValue( wgetCloserValue.getSelection() );
  input.setMaximalValue( wmaxValue.getText() );
  input.setMinimalValue( wminValue.getText() );

  input.setOutputMatchField( wmatchField.getText() );
  input.setOutputValueField( wvalueField.getText() );
  input.setSeparator( wseparator.getText() );

  int nrvalues = wReturn.nrNonEmpty();
  input.allocate( nrvalues );
  if ( isDebug() ) {
    logDebug( BaseMessages.getString( PKG, "FuzzyMatchDialog.Log.FoundFields", nrvalues + "" ) );
  }
  //CHECKSTYLE:Indentation:OFF
  for ( int i = 0; i < nrvalues; i++ ) {
    TableItem item = wReturn.getNonEmpty( i );
    input.getValue()[i] = item.getText( 1 );
    input.getValueName()[i] = item.getText( 2 );
    if ( input.getValueName()[i] == null || input.getValueName()[i].length() == 0 ) {
      input.getValueName()[i] = input.getValue()[i];
    }
  }

  StreamInterface infoStream = input.getStepIOMeta().getInfoStreams().get( 0 );
  infoStream.setStepMeta( transMeta.findStep( wStep.getText() ) );
  if ( infoStream.getStepMeta() == null ) {
    MessageBox mb = new MessageBox( shell, SWT.OK | SWT.ICON_ERROR );
    if ( Utils.isEmpty( wStep.getText() ) ) {
      mb.setMessage( BaseMessages.getString( PKG, "FuzzyMatchDialog.NotStepSpecified.DialogMessage", wStep
        .getText() ) );
    } else {
      mb.setMessage( BaseMessages.getString( PKG, "FuzzyMatchDialog.StepCanNotFound.DialogMessage", wStep
        .getText() ) );
    }

    mb.setText( BaseMessages.getString( PKG, "FuzzyMatchDialog.StepCanNotFound.DialogTitle" ) );
    mb.open();
  }

  stepname = wStepname.getText(); // return value

  dispose();
}
 

开发者ID:pentaho,
项目名称:pentaho-kettle,
代码行数:54,
代码来源:FuzzyMatchDialog.java

示例12: activeAlgorithm

点赞 2

import org.pentaho.di.trans.steps.fuzzymatch.FuzzyMatchMeta; //导入依赖的package包/类
private void activeAlgorithm() {
  boolean enable =
    ( FuzzyMatchMeta.getAlgorithmTypeByDesc( wAlgorithm.getText() )
        == FuzzyMatchMeta.OPERATION_TYPE_LEVENSHTEIN
      || FuzzyMatchMeta.getAlgorithmTypeByDesc( wAlgorithm.getText() )
        == FuzzyMatchMeta.OPERATION_TYPE_NEEDLEMAN_WUNSH
      || FuzzyMatchMeta.getAlgorithmTypeByDesc( wAlgorithm.getText() )
        == FuzzyMatchMeta.OPERATION_TYPE_DAMERAU_LEVENSHTEIN
      || FuzzyMatchMeta.getAlgorithmTypeByDesc( wAlgorithm.getText() )
        == FuzzyMatchMeta.OPERATION_TYPE_JARO
      || FuzzyMatchMeta.getAlgorithmTypeByDesc( wAlgorithm.getText() )
        == FuzzyMatchMeta.OPERATION_TYPE_JARO_WINKLER || FuzzyMatchMeta
      .getAlgorithmTypeByDesc( wAlgorithm.getText() ) == FuzzyMatchMeta.OPERATION_TYPE_PAIR_SIMILARITY );

  wlgetCloserValue.setEnabled( enable );
  wgetCloserValue.setEnabled( enable );
  wlminValue.setEnabled( enable );
  wminValue.setEnabled( enable );
  wlmaxValue.setEnabled( enable );
  wmaxValue.setEnabled( enable );

  if ( FuzzyMatchMeta.getAlgorithmTypeByDesc( wAlgorithm.getText() )
      == FuzzyMatchMeta.OPERATION_TYPE_JARO
    || FuzzyMatchMeta.getAlgorithmTypeByDesc( wAlgorithm.getText() )
      == FuzzyMatchMeta.OPERATION_TYPE_JARO_WINKLER
    || FuzzyMatchMeta.getAlgorithmTypeByDesc( wAlgorithm.getText() )
      == FuzzyMatchMeta.OPERATION_TYPE_PAIR_SIMILARITY ) {
    if ( Const.toDouble( transMeta.environmentSubstitute( wminValue.getText() ), 0 ) > 1 ) {
      wminValue.setText( String.valueOf( 1 ) );
    }
    if ( Const.toDouble( transMeta.environmentSubstitute( wmaxValue.getText() ), 0 ) > 1 ) {
      wmaxValue.setText( String.valueOf( 1 ) );
    }
  }

  boolean enableCaseSensitive =
    ( FuzzyMatchMeta.getAlgorithmTypeByDesc( wAlgorithm.getText() )
    == FuzzyMatchMeta.OPERATION_TYPE_LEVENSHTEIN || FuzzyMatchMeta
      .getAlgorithmTypeByDesc( wAlgorithm.getText() ) == FuzzyMatchMeta.OPERATION_TYPE_DAMERAU_LEVENSHTEIN );
  wlcaseSensitive.setEnabled( enableCaseSensitive );
  wcaseSensitive.setEnabled( enableCaseSensitive );
  activegetCloserValue();
}
 

开发者ID:pentaho,
项目名称:pentaho-kettle,
代码行数:44,
代码来源:FuzzyMatchDialog.java


版权声明:本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系管理员进行删除。
喜欢 (0)