Skip to content

Instantly share code, notes, and snippets.

@tondrej
Created April 15, 2018 15:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tondrej/1e77bee6e8048651e44a2536a04de2b8 to your computer and use it in GitHub Desktop.
Save tondrej/1e77bee6e8048651e44a2536a04de2b8 to your computer and use it in GitHub Desktop.
FastText C-style API bindings for Delphi and Free Pascal
const
FastTextLib = 'fasttext.dll';
type
TFastTextNNCallback = function(word: PAnsiChar; score: Single; data: Pointer): LongBool; cdecl;
function fasttext_new(out ft: TFastText): LongBool; cdecl; external FastTextLib;
function fasttext_release(ft: TFastText): LongBool; cdecl; external FastTextLib;
function fasttext_nn2(ft: TFastText; mx: TMatrix; positive, negative: PPAnsiChar; count: Integer;
callback: TFastTextNNCallback; data: Pointer): LongBool; cdecl; external FastTextLib;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment