Skip to content

Commit

Permalink
another try at private members
Browse files Browse the repository at this point in the history
  • Loading branch information
Hugo-ter-Doest committed Dec 7, 2023
1 parent 6b7e871 commit 2c7a69f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 11 deletions.
4 changes: 2 additions & 2 deletions lib/natural/brill_pos_tagger/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ THE SOFTWARE.

import { Feature } from '../classifiers'

declare interface RuleTemplatesItem {
declare interface RuleTemplatesItem {
function: (sentence: Sentence, i: number, parameter1?: string, parameter2?: string) => boolean
window: number[]
nrParameters: number
Expand Down Expand Up @@ -95,7 +95,7 @@ export class Lexicon {
setDefaultCategories (category: string, categoryCapitalised: string): void
}

export class Corpus {
declare class Corpus {
constructor (data: string | Corpus, typeOfCorpus: number, SentenceClass: typeof Sentence)
private wordCount: number
private sentences: Sentence[]
Expand Down
14 changes: 5 additions & 9 deletions lib/natural/tokenizers/aggressive_tokenizer_de.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,16 +23,12 @@ THE SOFTWARE.
'use strict'

const Tokenizer = require('./tokenizer')
const util = require('util')

const AggressiveTokenizer = function () {
Tokenizer.call(this)
class AggressiveTokenizer extends Tokenizer {
tokenize (text) {
// break a string up into an array of tokens by anything non-word
return this.trim(text.split(/[^a-zA-Z0-9ßäöü_'-]+/))
}
}
util.inherits(AggressiveTokenizer, Tokenizer)

module.exports = AggressiveTokenizer

AggressiveTokenizer.prototype.tokenize = function (text) {
// break a string up into an array of tokens by anything non-word
return this.trim(text.split(/[^a-zA-Z0-9_'-]+/))
}

0 comments on commit 2c7a69f

Please sign in to comment.