trichview.com Forum Index trichview.com
TRichView support forums
 

is there any problem working with two dictionary?


 
Post new topic   Reply to topic    trichview.com Forum Index -> Support
    View previous topic :: View next topic  
Author Message
alexandreq



Joined: 18 Jan 2012
Posts: 169

PostPosted: Fri Feb 24, 2012 2:26 pm    Post subject: is there any problem working with two dictionary? Reply with quote

I noticed that sometimes the routine works fine with two loaded dictionary and sometimes it doesn't. Well, most of the time it doesn't work.

It works fine when I load only one dictionary.

Is There anything wrong with my code?

Code:


procedure TFTMNLeitor.FormCreate(Sender: TObject);
begin
  // Creating a spell checker component
  RVdxSpellChecker1 := TRVdxSpellChecker.Create(Self);
  RVdxSpellChecker1.OnSpellFormAction := RVdxSpellChecker1SpellFormAction;

  CarregaDicionario('dic\pt_BR.aff','dic\pt_BR.dic',1046, 1252,2,HaDicPT);  // Portuguese Dictionary
  CarregaDicionario('dic\en_US.aff','dic\en_US.dic',1033, 0,   1,HaDicUSA); // English Dictionary

  LoadedDicnary := True;

  if (HaDicUSA=False) and (HaDicPT=false) Then LoadedDicnary := False;
End

procedure TFTMNLeitor.CarregaDicionario(aff, dic : string; Lang, pag, tipo: Integer; out HaDic: Boolean);
const
  DictionaryClasses: array[0..2] of TdxCustomSpellCheckerDictionaryClass = (TdxHunspellDictionary, TdxOpenOfficeDictionary, TdxISpellDictionary);
var
  ADictionaryItem: TdxSpellCheckerDictionaryItem;

begin
  If FileExists(aff) and FileExists(dic)  Then HaDic := True
  Else HaDic := False;

  if HaDic Then Begin
     PopupMenu1.AutoHotkeys := maManual;

     // Adding ISpell English dictionary
     ADictionaryItem := RVdxSpellChecker1.DictionaryItems.Add;
     ADictionaryItem.DictionaryTypeClass := DictionaryClasses[tipo];
     with TdxISpellDictionary(ADictionaryItem.DictionaryType) do begin
          if aff<>'' Then GrammarPath    := aff;
          if dic<>'' Then DictionaryPath := dic;
          Language := Lang;
          if tipo=2 Then Begin
             CodePage := pag;
          end;
     End;

     RVdxSpellChecker1.LoadDictionaries;
     RVdxSpellChecker1.UpdateRules;
  End;
end;
Back to top
View user's profile Send private message Send e-mail MSN Messenger
alexandreq



Joined: 18 Jan 2012
Posts: 169

PostPosted: Fri Feb 24, 2012 2:35 pm    Post subject: Reply with quote

You can downloaded the Portuguese dictionary from here

http://www.broffice.org/files/pt_BR-2011-05-27AOC.zip
Back to top
View user's profile Send private message Send e-mail MSN Messenger
Sergey Tkachenko
Site Admin


Joined: 27 Aug 2005
Posts: 11116

PostPosted: Fri Feb 24, 2012 4:07 pm    Post subject: Reply with quote

Sorry, we cannot accept bug reports for old version of TRichView.

Did you follow the advices from http://www.trichview.com/forums/viewtopic.php?t=3198 ?
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    trichview.com Forum Index -> Support All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group