Text

Answered

Import Issue. In case of custom recourse

Hi,

Scenario: if the custom grammar file has word with the character "%". transcription works fine. But while importing the same word. it doesn't work.

image

below is the text file restest.txt (used to create restest.res):

image

Below is the screenshot of import. It doesn't work.  

image

but while writing with trokes. it recognizes. 

image

Please. check with the character %. and get help us out. 

Regards,

Mitesh



Best Answer

Dear Mitesh,


here is the way I import "0.03%": editorView.getEditor().import_(MimeType.TEXT, "0.03%", null);


And the source of the lexicon is contained into the aboe zip file as 003percent.lex.


For sure this is a space issue, if you cannot find where a space is added, we invite you to use your second lexicon.


Best regards,


Olivier


Dear Mitesh,


can you please provide us the source ouf your restest resource and the way you proceed to do your import?


Thank you,


Best regards,


Olivier

Here is the code you wanted.

image

As the below file, if only the word '0.03%' used; recognition works fine but, the import isn't working. 

image

Now if we add as this below format. It works. The recognition and The import works perfectly. for all 3 strings. 

image

Now, the thing is; we can't separately add all values. 

As it should work as a custom grammar.

Please take a look at it. and try this example by your self. 

Regards, 

Mitesh



Dea Mitesh,


currently, I just tried on my side and it is working fine. You can find my resource and source code at the following link: https://myscript.filecamp.com/s/gYIQ683vIzgJhoyE/fo


I would tend to think of an encoding issue (your lex file should be encoded in UTF-8).


Or maybe you add a space, as using the grm will add a space in between each word.


Best regards,


Olivier

I've used 003percent.res file, that you have provided. It is not working. still the same issue.

Can you provide source code? You have mentioned but I can't find the source code via that link.

And yes, the text files I've used earlier are encoded in UTF-8. You can check the right bottom corner in the screenshots.  

Answer

Dear Mitesh,


here is the way I import "0.03%": editorView.getEditor().import_(MimeType.TEXT, "0.03%", null);


And the source of the lexicon is contained into the aboe zip file as 003percent.lex.


For sure this is a space issue, if you cannot find where a space is added, we invite you to use your second lexicon.


Best regards,


Olivier

Hello Olivier,

This doesn't seem to be a space issue. The issue is with the conjunction of number and a character.

The same issue is occurring with "0.03#" & "0.03$"

Please test again. I have tried many combinations with the lexicon file. adding space at the end and adding a new line and many more.

The import of combined custom word; works only when the containing number and character both are added separately in the lexicon. 

Regards,

Mitesh


And also note I am using the custom grammar. (grm resource) 

please use this resource files that I am using 

https://drive.google.com/drive/folders/1UEpnyxNeLL2kztCOU5M8wpWEi71nx4kt?usp=sharing

Dear Mitesh,


I just tried your resource on my side, and I could easily import the "0.0.3%" text: editorView.getEditor().import_(MimeType.TEXT, "0.03%", null);


Maybe you are trying to import anything else? If so, then you shall add the lk-text resource.


On my side, I consider this issue is closed.


Best regards,


Olivier