Tabnine Logo For Javascript
Array.toJsArray
Code IndexAdd Tabnine to your IDE (free)

How to use
toJsArray
function
in
Array

Best JavaScript code snippets using builtins.Array.toJsArray(Showing top 15 results out of 315)

origin: koalanlp/nodejs-support

_getEntity(e) {
    let enty = new Entity({
      surface: e.getSurface(),
      label: e.getLabel().name(),
      fineLabel: e.getFineLabel(),
      morphemes: JVM.toJsArray(e, (x) => this._getMorph(x)),
      originalLabel: getOrUndefined(e.getOriginalLabel())
    });
    enty.reference = e;

    return enty;
  }
origin: koalanlp/nodejs-support

_getRole(e) {
    let edge = new RoleEdge({
      predicate: this._getWord(e.getPredicate()),
      argument: this._getWord(e.getArgument()),
      label: e.getLabel().name(),
      modifiers: JVM.toJsArray(e.getModifiers(), (x) => this._getWord(x)),
      originalLabel: getOrUndefined(e.getOriginalLabel())
    });
    edge.reference = e;

    return edge;
  }
origin: koalanlp/nodejs-support

_getCorefGroup(c) {
    let coref = new CoreferenceGroup(
      JVM.toJsArray(c, (e) => {
        let referenced = this._getEntity(e);
        return this.entities.find((enty) => enty.equals(referenced));
      })
    );

    coref.reference = c;
    return coref;
  }
origin: koalanlp/nodejs-support

/**
   * 전체 값의 목록을 불러옵니다.
   * @param clsName 불러올 클래스
   * @returns {Array} 전체 값 목록
   */
  static getAllOf(...clsName){
    return JVM.toJsArray(JVM.koalaClassOf(...clsName).values());
  }
origin: koalanlp/nodejs-support

/**
   * 사전에 등재되어 있는지 확인하고, 사전에 없는단어만 반환합니다.
   * @param {boolean} onlySystemDic 시스템 사전에서만 검색할지 결정합니다.
   * @param {DicEntry} word {'surface':형태소, 'tag':품사}들. (가변인자)
   * @return {DicEntry[]} 사전에 없는 단어들
   */
  async getNotExists(onlySystemDic, ...word) {
    let zipped = word.map((pair) => JVM.pair(pair.surface, pair.tag.reference));
    return JVM.toJsArray(await this._api.getNotExistsPromise(onlySystemDic, ...zipped), readDicEntry);
  }
origin: koalanlp/nodejs-support

/**
   * KoalaNLP가 구현한 문장분리기를 사용하여, 문단을 문장으로 분리합니다. (Synchronous)
   * @param {Word[]} paragraph 분석할 문단. (품사표기가 되어있어야 합니다)
   * @returns {Sentence} 분리된 문장
   */
  static sentencesSync(paragraph) {
    let sent = [];
    for (let word of paragraph) {
      sent.push(word.getReference());
    }

    return JVM.toJsArray(JVM.koalaClassOf('proc', 'SentenceSplitter').INSTANCE.sentences(sent), (x) => new Sentence(x));
  }
origin: koalanlp/nodejs-support

/**
   * 문단(들)을 품사분석합니다. (Synchronous)
   * @param {...(string|string[])} text 분석할 문단들. 텍스트와 string 리스트 혼용 가능. (가변인자)
   * @returns {Sentence[]} 분석된 결과 (Flattened list)
   */
  tagSync(...text) {
    let result = [];
    for (let paragraph of text) {
      if (Array.isArray(paragraph)) {
        result.push(...this.tagSync(...paragraph));
      } else {
        if (paragraph.trim().length == 0)
          continue;

        result.push(...JVM.toJsArray(this._api.tag(paragraph), (x) => new Sentence(x)));
      }
    }
    return result;
  }
origin: koalanlp/nodejs-support

/**
   * 사용자 사전에 등재된 모든 항목을 가져옵니다.
   * @return {DicEntry[]} {'surface':형태소, 'tag':품사}의 list
   */
  async getItems() {
    return JVM.toJsArray(await this._api.getItemsPromise(), readDicEntry, true);
  }
origin: koalanlp/nodejs-support

/**
   * 문단(들)을 분석합니다. (Synchronous)
   *
   * @param {...(string|Sentence|string[]|Sentence[])} text 분석할 문단(들).
   * 각 인자는 텍스트(str), 문장 객체(Sentence), 텍스트의 리스트, 문장 객체의 리스트 혼용 가능 (가변인자)
   * @returns {Sentence[]} 분석된 결과 (Flattened list)
   */
  analyzeSync(...text) {
    let result = [];
    for (let paragraph of text) {
      if (paragraph instanceof Sentence) {
        result.push(new Sentence(this._api.analyze(paragraph.reference)));
      } else if (Array.isArray(paragraph)) {
        result.push(...this.analyzeSync(...paragraph));
      } else {
        if (paragraph.trim().length == 0)
          continue;

        result.push(...JVM.toJsArray(this._api.analyze(paragraph), (x) => new Sentence(x)));
      }
    }

    return result;
  }
origin: koalanlp/nodejs-support

_reconSyntaxTree(jtree) {
    if (!isDefined(jtree))
      return undefined;

    let term;
    let nonTerms;

    if (isDefined(jtree.getTerminal())) {
      term = this._getWord(jtree.getTerminal());
    }

    if (jtree.hasNonTerminals()) {
      nonTerms = JVM.toJsArray(jtree, (x) => this._reconSyntaxTree(x));
    }

    let tree = new SyntaxTree({
      label: jtree.getLabel().name(),
      terminal: term,
      children: nonTerms,
      originalLabel: getOrUndefined(jtree.getOriginalLabel())
    });
    tree.reference = jtree;

    return tree;
  }
origin: koalanlp/nodejs-support

/**
   * 문단(들)을 분석합니다. (Asynchronous)
   *
   * @param {...(string|Sentence|string[]|Sentence[])} text 분석할 문단(들).
   * 각 인자는 텍스트(str), 문장 객체(Sentence), 텍스트의 리스트, 문장 객체의 리스트 혼용 가능 (가변인자)
   * @returns {Sentence[]} 분석된 결과 (Flattened list)
   */
  async analyze(...text) {
    let result = [];
    for (let paragraph of text) {
      let promiseResult;
      if (paragraph instanceof Sentence) {
        promiseResult = await this._api.analyzePromise(paragraph.reference);
        result.push(new Sentence(promiseResult));
      } else if (Array.isArray(paragraph)) {
        promiseResult = await this.analyze(...paragraph);
        result.push(...promiseResult);
      } else {
        if (paragraph.trim().length == 0)
          continue;

        promiseResult = await this._api.analyzePromise(paragraph);
        result.push(...JVM.toJsArray(promiseResult, (x) => new Sentence(x)));
      }
    }

    return result;
  }
origin: koalanlp/nodejs-support

/**
   * KoalaNLP가 구현한 문장분리기를 사용하여, 문단을 문장으로 분리합니다. (Asynchronous)
   * @param {Word[]} paragraph 분석할 문단. (품사표기가 되어있어야 합니다)
   * @returns {Sentence} 분리된 문장
   */
  static async sentences(paragraph) {
    let sent = [];
    for (let word of paragraph) {
      sent.push(word.getReference());
    }

    let promiseResult = await JVM.koalaClassOf('proc', 'SentenceSplitter').INSTANCE.sentencesPromise(sent);
    return JVM.toJsArray(promiseResult, (x) => new Sentence(x));
  }
origin: koalanlp/nodejs-support

/**
   * 문단을 문장으로 분리합니다. (Asynchronous)
   * @param {...!string} text 분석할 문단들 (가변인자)
   * @returns {string[]} 분리한 문장들.
   */
  async sentences(...text) {
    let result = [];
    for (let paragraph of text) {
      if (Array.isArray(paragraph)) {
        result.push(...await this.sentences(...paragraph));
      } else {
        if (paragraph.trim().length == 0)
          continue;

        let promiseResult = await this._api.sentencesPromise(paragraph);
        result.push(...JVM.toJsArray(promiseResult));
      }
    }
    return result;
  }
origin: koalanlp/nodejs-support

/**
   * 문단(들)을 품사분석합니다. (Asynchronous)
   * @param {...(string|string[])} text 분석할 문단들. 텍스트와 string 리스트 혼용 가능. (가변인자)
   * @returns {Sentence[]} 분석된 결과 (Flattened list)
   */
  async tag(...text) {
    let result = [];
    for (let paragraph of text) {
      let promiseResult;
      if (Array.isArray(paragraph)) {
        promiseResult = await this.tag(...paragraph);
        result.push(...promiseResult);
      } else {
        if (paragraph.trim().length == 0)
          continue;

        promiseResult = await this._api.tagPromise(paragraph);
        result.push(...JVM.toJsArray(promiseResult, (x) => new Sentence(x)));
      }
    }
    return result;
  }
origin: koalanlp/nodejs-support

/**
   * 문단을 문장으로 분리합니다. (Synchronous)
   * @param {...!string} text 분석할 문단들 (가변인자)
   * @returns {string[]} 분리한 문장들.
   */
  sentencesSync(...text) {
    let result = [];
    for (let paragraph of text) {
      if (Array.isArray(paragraph)) {
        result.push(...this.sentencesSync(...paragraph));
      } else {
        if (paragraph.trim().length == 0)
          continue;

        result.push(...JVM.toJsArray(this._api.sentences(paragraph)));
      }
    }
    return result;
  }
builtins(MDN)ArraytoJsArray

Most used builtins functions

  • Console.log
  • Console.error
  • Promise.then
    Attaches callbacks for the resolution and/or rejection of the Promise.
  • Promise.catch
    Attaches a callback for only the rejection of the Promise.
  • Array.push
    Appends new elements to an array, and returns the new length of the array.
  • Array.length,
  • Array.map,
  • String.indexOf,
  • fetch,
  • Window.location,
  • Window.addEventListener,
  • ObjectConstructor.keys,
  • Array.forEach,
  • Location.reload,
  • Response.status,
  • Navigator.serviceWorker,
  • ServiceWorkerContainer.register,
  • ServiceWorkerRegistration.installing,
  • ServiceWorkerContainer.controller

Popular in JavaScript

  • request
    Simplified HTTP request client.
  • bluebird
    Full featured Promises/A+ implementation with exceptionally good performance
  • glob
    a little globber
  • axios
    Promise based HTTP client for the browser and node.js
  • colors
    get colors in your node.js console
  • js-yaml
    YAML 1.2 parser and serializer
  • path
  • q
    A library for promises (CommonJS/Promises/A,B,D)
  • winston
    A logger for just about everything.
  • Top 12 Jupyter Notebook extensions
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJavascript Code Index
Get Tabnine for your IDE now