Loads UTF-8 encoded text asynchronously. The returned state instance provides a means to
listen for the arrival of the text.

@param path the path to the text asset.
491727
public RFuture<String> getText (final String path) {
    final RPromise<String> result = exec.deferredPromise();
    exec.invokeAsync(new Runnable() {
      public void run () {
        try {
          result.succeed(getTextSync(path));
        } catch (Throwable t) {
          result.fail(t);
        }
      }
    });
    return result;
  }
1244961
public static void loadParser(String path) throws LoadModelException {
		if(parser==null){
			String file = path+parseModel;
			parser = new JointParser(file);
		}
	}
653965
public AbstractCharSequenceAssert<?, String> jsonPathAsString(String path) {
        return Assertions.assertThat(actual.read(path, String.class));
    }
769901
def read_string_from_file(path, encoding="utf8"):
  
  with codecs.open(path, "rb", encoding=encoding) as f:
    value = f.read()
  return value
544466
def read_file(cls, path):
        
        with open(path, encoding="utf-8") as file:
            file_contents = file.read()
            return cls.read(file_contents)
832743
def load(path, **kw):
    
    _kw = {}
    if PY3:  # pragma: no cover
        _kw['encoding'] = 'utf-8'
    with open(str(path), **_kw) as fp:
        return json.load(fp, **kw)
140281
private static List<ContextWords> loadContextWords(String path) {
    List<ContextWords> set = new ArrayList<>();
    InputStream stream = JLanguageTool.getDataBroker().getFromRulesDirAsStream(path);
    try (Scanner scanner = new Scanner(stream, "utf-8")) {
      while (scanner.hasNextLine()) {
        String line = scanner.nextLine();
        if (line.trim().isEmpty() || line.charAt(0) == '#') {
          continue;
        }
        String[] column = line.split("\t");
        if (column.length >= 6) {
          ContextWords contextWords = new ContextWords();
          contextWords.setWord(0, column[0]);
          contextWords.setWord(1, column[1]);
          contextWords.matches[0] = column[2];
          contextWords.matches[1] = column[3];
          contextWords.setContext(0, column[4]);
          contextWords.setContext(1, column[5]);
          if (column.length > 6) {
            contextWords.explanations[0] = column[6];
            if (column.length > 7) {
              contextWords.explanations[1] = column[7];
            }
          }
          set.add(contextWords);
        } // if (column.length >= 6)
      }
    }
    return Collections.unmodifiableList(set);
  }
636467
public static void loadDict(String... path) throws LoadModelException {

		for(String file:path){
			dict.addFile(file);
		}
		setDict();

	}
368013
public static BufferedWriter asBufferedWriter(Path path) throws IOException {
		Validate.notNull(path, "path is null");
		return Files.newBufferedWriter(path, Charsets.UTF_8);
	}
759569
public static String readAsString( String path ) {
		InputStream stream = openStream(path);
		if( stream == null ) {
			System.err.println("Failed to open "+path);
			return null;
		}
		return readAsString(stream);
	}
870067
public String getFileContents(String path) throws Exception {
        ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
        Resources.copy(Pages.class.getResource(path), outputStream);
        return new String(outputStream.toByteArray(), "UTF-8");
    }
1039081
function loadTranslation(localeFilePath) {
    if(typeof localeFilePath == "undefined"){
        messages = defaultMessages;
        return null;
    }
    let fp = path.join(__dirname, localeFilePath);
    messages = require('jsonfile').readFileSync("." + fp);
    return messages;
}
909941
public static String decodePath(String path) {
        if (path.indexOf('%') < 0) {
            // No need to decoded; not percent-encoded
            return path;
        }

        // Decode percent-encoded characters.
        // An invalid character is replaced with 0xFF, which will be replaced into '�' by UTF-8 decoder.
        final int len = path.length();
        final byte[] buf = new byte[len];
        int dstLen = 0;
        for (int i = 0; i < len; i++) {
            final char ch = path.charAt(i);
            if (ch != '%') {
                buf[dstLen++] = (byte) ((ch & 0xFF80) == 0 ? ch : 0xFF);
                continue;
            }

            // Decode a percent-encoded character.
            final int hexEnd = i + 3;
            if (hexEnd > len) {
                // '%' or '%x' (must be followed by two hexadigits)
                buf[dstLen++] = (byte) 0xFF;
                break;
            }

            final int digit1 = decodeHexNibble(path.charAt(++i));
            final int digit2 = decodeHexNibble(path.charAt(++i));
            if (digit1 < 0 || digit2 < 0) {
                // The first or second digit is not hexadecimal.
                buf[dstLen++] = (byte) 0xFF;
            } else {
                buf[dstLen++] = (byte) ((digit1 << 4) | digit2);
            }
        }

        return new String(buf, 0, dstLen, StandardCharsets.UTF_8);
    }
205192
def load_stopwords(self, path):

        

        if path:
            with open(path) as f:
                self.stopwords = set(f.read().splitlines())

        else:
            self.stopwords = set(
                pkgutil
                .get_data('textplot', 'data/stopwords.txt')
                .decode('utf8')
                .splitlines()
            )
590226
private JsonObject load(Path path) throws IOException {
    try (InputStream stream = Resources.getResource(path.toString()).openStream()) {
      return (JsonObject) JSON_PARSER.parse(new InputStreamReader(stream));
    }
  }
1160758
def load_unicode(self, resource_path):
        
        resource_content = pkg_resources.resource_string(self.module_name, resource_path)
        return resource_content.decode('utf-8')
545387
def write(text, path):
    
    with open(path, "wb") as f:
        f.write(text.encode("utf-8"))