Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failed to configure tokenizer #3

Open
lspliner opened this issue Sep 30, 2016 · 1 comment
Open

Failed to configure tokenizer #3

lspliner opened this issue Sep 30, 2016 · 1 comment

Comments

@lspliner
Copy link

var Az = require("az");
var tokens = Az.Tokens();
tokens.append(input, {});
tokens = tokens.done();

This code throws exception on line 3:
config = config ? Az.extend(this.config, config) : this.config;
ReferenceError: Az is not defined

@andrey-pavlenko
Copy link

Добрый день.

linux, node v9.11.1

Такой код (без config) работает:

const Az = require('az');
const tokens = Az.Tokens('Мама мыла раму').done(['SPACE'], true));

Такой код (Tokens вызывается с config):

const Az = require('az');
const tokens = Az.Tokens('Мама <b>мыла</b> раму', { html: true })
  .done(['SPACE'], true)
);

Ошибка:

/home/node_modules/az/dist/az.js:1700
        this.config = config ? Az.extend(defaults, config) : defaults;
                               ^

ReferenceError: Az is not defined
    at new Tokens (/home/node_modules/az/dist/az.js:1700:32)
    at Object.Tokens (/home/node_modules/az/dist/az.js:1707:14)
    at Object.<anonymous> (/home/src/message.js:8:19)
    at Module._compile (internal/modules/cjs/loader.js:654:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:665:10)
    at Module.load (internal/modules/cjs/loader.js:566:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:506:12)
    at Function.Module._load (internal/modules/cjs/loader.js:498:3)
    at Function.Module.runMain (internal/modules/cjs/loader.js:695:10)
    at startup (internal/bootstrap/node.js:201:19)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants