trichview.com

trichview.support




Re: Word Count


Return to index


Author

Message

Sergey Tkachenko

Posted: 07/28/2004 22:37:15


You can use a class from

http://www.trichview.com/resources/spell/rvspell.zip.

You need a unit RVWordEnum.pas from there (other files are specific for some

spell checkers).


Create a class


TWordCounter = class(TRVWordEnumerator)

private

    FCounter: Integer;

protected

    function ProcessWord: Boolean; override;

public

   function GetWordCount(rve: TCustomRichViewEdit): Integer;

end;


function TWordCounter.ProcessWord: Boolean;

begin

  inc(FCounter);

  Result := True;

end;


function TWordCounter.GetWordCount(rve: TCustomRichViewEdit): Integer;

begin

  FCounter := 0;

  Run(rve, rvesFromStart);

  Result := FCounter;

end;



> What's the best way to get an accurate word count. I'm using addict 3

spell

> checker if that helps?





Powered by ABC Amber Outlook Express Converter