dart_native_annoy 0.1.0+1 dart_native_annoy: ^0.1.0+1 copied to clipboard
A dart binding to native annoy library to serve pre-built Annoy index.
Getting Started #
import 'dart:ffi';
import 'package:dart_native_annoy/annoy.dart';
/// Creat factory from DynamicLibrary
final fac = AnnoyIndexFactory(lib: DynamicLibrary.open('libru_annoy.so'));
/// Load index
final index = indexFactory.loadIndex(
'index.euclidean.5d.ann', 5, IndexType.Euclidean)!;
print('size: ${index.size}');
final v3 = index.getItemVector(3);
final nearest = index.getNearest(v0, 5, includeDistance: true);
To get more examples #
Go to unit test