Codota Logo
TextFileDictionary
Code IndexAdd Codota to your IDE (free)

How to use
TextFileDictionary
in
org.datacleaner.reference

Best Java code snippets using org.datacleaner.reference.TextFileDictionary (Showing top 7 results out of 315)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
DateTime d =
  • Codota Iconnew DateTime()
  • Codota IconDateTimeFormatter formatter;String text;formatter.parseDateTime(text)
  • Codota IconObject instant;new DateTime(instant)
  • Smart code suggestions by Codota
}
origin: datacleaner/DataCleaner

private Element toElement(final TextFileDictionary dictionary) {
  final Element elem = getDocument().createElement("text-file-dictionary");
  elem.setAttribute("name", dictionary.getName());
  if (!Strings.isNullOrEmpty(dictionary.getDescription())) {
    elem.setAttribute("description", dictionary.getDescription());
  }
  appendElement(elem, "filename", dictionary.getFilename());
  appendElement(elem, "encoding", dictionary.getEncoding());
  appendElement(elem, "case-sensitive", dictionary.isCaseSensitive());
  return elem;
}
origin: datacleaner/DataCleaner

@Override
public DictionaryConnection openConnection(final DataCleanerConfiguration configuration) {
  final ResourceConverter rc = new ResourceConverter(configuration);
  final Resource resource = rc.fromString(Resource.class, _filename);
  final Set<String> values = resource.read(in -> {
    final Set<String> values1 = new HashSet<>();
    final BufferedReader reader = FileHelper.getBufferedReader(in, getEncoding());
    try {
      String line = reader.readLine();
      while (line != null) {
        if (!_caseSensitive) {
          line = line.toLowerCase();
        }
        values1.add(line);
        line = reader.readLine();
      }
    } catch (final IOException e) {
      logger.error("Failed to read line from resource: {}", resource, e);
    } finally {
      FileHelper.safeClose(reader);
    }
    return values1;
  });
  final SimpleDictionary simpleDictionary = new SimpleDictionary(getName(), values, _caseSensitive);
  return simpleDictionary.openConnection(configuration);
}
origin: datacleaner/DataCleaner

@Override
public String toString() {
  return "TextFileDictionary[name=" + getName() + ", filename=" + _filename + ", encoding=" + _encoding + "]";
}
origin: datacleaner/DataCleaner

final TextFileDictionary dict = new TextFileDictionary(name, filename, encoding, caseSensitive);
dict.setDescription(tfdt.getDescription());
dictionaryList.add(dict);
origin: datacleaner/DataCleaner

private static String getDescription(final Dictionary dictionary) {
  if (dictionary.getDescription() != null) {
    return dictionary.getDescription();
  }
  if (dictionary instanceof TextFileDictionary) {
    return ((TextFileDictionary) dictionary).getFilename();
  } else if (dictionary instanceof DatastoreDictionary) {
    final DatastoreDictionary datastoreDictionary = (DatastoreDictionary) dictionary;
    return datastoreDictionary.getDatastoreName() + ": " + datastoreDictionary.getQualifiedColumnName();
  } else if (dictionary instanceof SimpleDictionary) {
    final SimpleDictionary simpleDictionary = (SimpleDictionary) dictionary;
    final Collection<String> values = simpleDictionary.getValueSet();
    final StringBuilder sb = new StringBuilder();
    for (final String value : values) {
      if (sb.length() > 0) {
        sb.append(",");
      }
      sb.append(value);
      if (sb.length() > 20) {
        break;
      }
    }
    return sb.toString();
  }
  return "";
}
origin: datacleaner/DataCleaner

final TextFileDictionary dict = new TextFileDictionary(name1, path, encoding, caseSensitive);
origin: datacleaner/DataCleaner

_nameTextField.setText(dictionary.getName());
_resourceSelector.setResourcePath(dictionary.getFilename());
_encodingComboBox.setSelectedItem(dictionary.getEncoding());
_caseSensitiveCheckBox.setSelected(dictionary.isCaseSensitive());
org.datacleaner.referenceTextFileDictionary

Javadoc

Dictionary based on a simple text file containing the values of the dictionary. Each line of the file will be treated as a value within the dictionary.

Most used methods

  • getEncoding
  • getName
  • <init>
  • getFilename
  • isCaseSensitive
  • getDescription
  • setDescription

Popular in Java

  • Parsing JSON documents to java classes using gson
  • getExternalFilesDir (Context)
  • scheduleAtFixedRate (Timer)
    Schedules the specified task for repeated fixed-rate execution, beginning after the specified delay.
  • onRequestPermissionsResult (Fragment)
  • Runnable (java.lang)
    Represents a command that can be executed. Often used to run code in a different Thread.
  • ConnectException (java.net)
    A ConnectException is thrown if a connection cannot be established to a remote host on a specific po
  • SocketException (java.net)
    This SocketException may be thrown during socket creation or setting options, and is the superclass
  • URLEncoder (java.net)
    This class is used to encode a string using the format required by application/x-www-form-urlencoded
  • MessageDigest (java.security)
    Uses a one-way hash function to turn an arbitrary number of bytes into a fixed-length byte sequence.
  • LogFactory (org.apache.commons.logging)
    A minimal incarnation of Apache Commons Logging's LogFactory API, providing just the common Log look
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now