当前位置: 首页>>代码示例>>Java>>正文


Java WordList类代码示例

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


WordList类属于org.apache.hadoop.tools.rumen.anonymization包,在下文中一共展示了WordList类的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: anonymizePath

import org.apache.hadoop.tools.rumen.anonymization.WordList; //导入依赖的package包/类
private static String anonymizePath(String path, WordList dState, 
                                    WordList fState) {
  StringBuilder buffer = new StringBuilder();
  StringTokenizer tokenizer = new StringTokenizer(path, Path.SEPARATOR, true);
  while (tokenizer.hasMoreTokens()) {
    String token = tokenizer.nextToken();
    if (Path.SEPARATOR.equals(token)) {
      buffer.append(token);
    } else if (Path.CUR_DIR.equals(token)) {
      buffer.append(token);
    } else if (PREV_DIR.equals(token)) {
      buffer.append(token);
    } else if (tokenizer.hasMoreTokens()){
      // this component is a directory
      buffer.append(anonymize(token, dState));
    } else {
      // this component is a file
      buffer.append(anonymize(token, fState));
    }
  }
  
  return buffer.toString();
}
 
开发者ID:naver,项目名称:hadoop,代码行数:24,代码来源:FileName.java

示例2: anonymize

import org.apache.hadoop.tools.rumen.anonymization.WordList; //导入依赖的package包/类
private static String anonymize(String data, WordList wordList) {
  if (data == null) {
    return null;
  }

  if (!wordList.contains(data)) {
    wordList.add(data);
  }
  return wordList.getName() + wordList.indexOf(data);
}
 
开发者ID:naver,项目名称:hadoop,代码行数:11,代码来源:DefaultAnonymizableDataType.java

示例3: anonymize

import org.apache.hadoop.tools.rumen.anonymization.WordList; //导入依赖的package包/类
private static String anonymize(String data, WordList wordList) {
  if (data == null) {
    return null;
  }

  if (WordListAnonymizerUtility.needsAnonymization(data)) {
    String suffix = "";
    String coreData = data;
    // check and extract suffix
    if (WordListAnonymizerUtility.hasSuffix(data, KNOWN_SUFFIXES)) {
      // check if the data ends with a known suffix
      String[] split = 
        WordListAnonymizerUtility.extractSuffix(data, KNOWN_SUFFIXES);
      suffix = split[1];
      coreData = split[0];
    }

    // check if the data is known content
    //TODO [Chunking] Do this for sub-strings of data
    String anonymizedData = coreData;
    if (!WordListAnonymizerUtility.isKnownData(coreData)) {
      if (!wordList.contains(coreData)) {
        wordList.add(coreData);
      }
      anonymizedData  = wordList.getName() + wordList.indexOf(coreData);
    }

    return anonymizedData + suffix;
  } else {
    return data;
  }
}
 
开发者ID:naver,项目名称:hadoop,代码行数:33,代码来源:FileName.java

示例4: getDirectoryState

import org.apache.hadoop.tools.rumen.anonymization.WordList; //导入依赖的package包/类
public WordList getDirectoryState() {
  return dirState;
}
 
开发者ID:naver,项目名称:hadoop,代码行数:4,代码来源:FileName.java

示例5: getFileNameState

import org.apache.hadoop.tools.rumen.anonymization.WordList; //导入依赖的package包/类
public WordList getFileNameState() {
  return fileNameState;
}
 
开发者ID:naver,项目名称:hadoop,代码行数:4,代码来源:FileName.java

示例6: setDirectoryState

import org.apache.hadoop.tools.rumen.anonymization.WordList; //导入依赖的package包/类
public void setDirectoryState(WordList state) {
  this.dirState = state;
}
 
开发者ID:naver,项目名称:hadoop,代码行数:4,代码来源:FileName.java

示例7: setFileNameState

import org.apache.hadoop.tools.rumen.anonymization.WordList; //导入依赖的package包/类
public void setFileNameState(WordList state) {
  this.fileNameState = state;
}
 
开发者ID:naver,项目名称:hadoop,代码行数:4,代码来源:FileName.java


注:本文中的org.apache.hadoop.tools.rumen.anonymization.WordList类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。