<commit_before>/**
 * URI generator
 */
package util

import java.io.File
import scalax.file.Path

/**
 * @author ShiZhan
 * URI generator
 * 1. Generate computer node URI from hostname
 * 2. Generate file URI from File instance with hostname
 * 3. Generate path URI from Path instance with hostname
 */
object URI {
  def fromHost = "file:/" + Platform.hostname
  def fromFile(f: File) = f.toURI.toString.replaceFirst("file:", fromHost)
  def fromPath(p: Path) = p.toAbsolute.toURI.toString.replaceFirst("file:", fromHost)
}<commit_msg>URI generate from String for creating individual ID<commit_after>/**
 * URI generator
 */
package util

import java.io.File
import java.net.URLEncoder
import scalax.file.Path

/**
 * @author ShiZhan
 * URI generator
 * 1. Generate computer node URI from hostname
 * 2. Generate file URI from File instance with hostname
 * 3. Generate path URI from Path instance with hostname
 */
object URI {
  def fromHost = "file:/" + Platform.hostname
  def fromFile(f: File) = f.toURI.toString.replaceFirst("file:", fromHost)
  def fromPath(p: Path) = p.toAbsolute.toURI.toString.replaceFirst("file:", fromHost)
  def fromString(s: String) = fromHost + '/' + URLEncoder.encode(s)
}
{'fraction_non_alphanumeric': 0.115990057995029, 'fraction_numerical': 0.004971002485501243, 'mean_word_length': 4.184549356223176, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4126068', 'n_tokens_mistral': 377, 'n_tokens_neox': 368, 'n_words': 122}