Skip to content

Unable to create custom dictionary #221

@mveer-jaipur

Description

@mveer-jaipur

Hi Team,

My requirements are,

  1. Add the words to a custom dictionary instead of a runtime dictionary. So I can share my custom dictionary with other users. As per API specification, I could not find this feature so could you please confirm if huspell-asm provides the same?
  2. I can use the spellcheck instance after unmounting and disposing of.
const aff = await fetch('assets/dictionaries/en_US.aff');  
const affBuffer = new Uint8Array(await aff.arrayBuffer());  
const affFile = hunspellFactory.mountBuffer(affBuffer, 'english.aff'); 

const dic = await fetch('assets/dictionaries/en_US.dic');
const dicBuffer = new Uint8Array(await dic.arrayBuffer());
const dictFile = hunspellFactory.mountBuffer(dicBuffer, "english.dic");

const hunspell = hunspellFactory.create(affFile, dictFile);

const test1 = hunspell.spell('hello'); // give me true

hunspellFactory.unmount('assets/dictionaries/en_US.aff');
hunspellFactory.unmount('assets/dictionaries/en_US.dic');
hunspell.dispose();

// Suppose to throw error while giving me true
const test2 = hunspell.spell('hello'); // give me true

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions