+
+# فـيس Faiss
+[[English]](readme.md)
+
+روابط لغة الأسس لمكتبة [FAISS](https://github.com/facebookresearch/faiss) - مكتبة للبحث الفعّال عن التشابه وتجميع المتجهات الكثيفة.
+
+## نظرة عامة
+
+توفر هذه المكتبة روابط لغة الأسس لمكتبة FAISS، مما يتيح عمليات البحث عن التشابه في المتجهات والتجميع عالية الأداء في لغة الأسس.
+
+## التثبيت
+
+```alusus
+اشمل "مـحا"؛
+مـحا.اشمل_ملف("Alusus/Faiss"، "فـيس.أسس")؛
+استخدم فـيس؛
+```
+
+أو بالإنجليزية:
+
+
+
+```alusus
+import "Apm";
+Apm.importFile("Alusus/Faiss");
+use Faiss;
+```
+
+
+
+## البدء السريع
+
+### مثال بالعربية
+
+```alusus
+اشمل "مـتم/طـرفية"؛
+اشمل "مـتم/مـصفوفة"؛
+اشمل "مـحا"؛
+مـحا.اشمل_ملف("Alusus/Faiss"، "فـيس.أسس")؛
+استخدم مـتم؛
+استخدم فـيس؛
+
+// إنشاء فهرس مسطح بمتجهات رباعية الأبعاد
+عرف الفهرس: سند[فـهرس]؛
+فـهرس.أنشئ(الفهرس، 4، "Flat"، نـوع_قياس._نتاج_داخلي_)؛
+
+// إضافة متجهات إلى الفهرس
+عرف سب: مـصفوفة[عـائم]({1.0، 2.0، 3.0، 4.0، 2.0، 3.0، 4.0، 5.0})؛
+الفهرس.أضف(2، سب.صوان)؛ // متجهان
+
+// البحث عن أقرب الجيران
+عرف سس: مـصفوفة[عـائم]({1.5، 2.5، 3.5، 4.5})؛
+عرف الوسوم: مصفوفة[صحيح[64]، 3]؛
+عرف المسافات: مصفوفة[عـائم، 3]؛
+الفهرس.ابحث(1، سس.صوان، 3، المسافات، الوسوم)؛ // البحث عن أقرب 3 جيران
+
+// التنظيف
+فـهرس.حرر(الفهرس)؛
+```
+
+### مثال بالإنجليزية
+
+
+
+```alusus
+import "Srl/Console";
+import "Srl/Array";
+import "Apm";
+Apm.importFile("Alusus/Faiss");
+use Srl;
+use Faiss;
+
+// Create a flat index with 4-dimensional vectors
+def index: ref[Index];
+Index.new(index, 4, "Flat", MetricType.METRIC_INNER_PRODUCT);
+
+// Add vectors to the index
+def xb: Array[Float]({1.0, 2.0, 3.0, 4.0, 2.0, 3.0, 4.0, 5.0});
+index.add(2, xb.buf); // 2 vectors
+
+// Search for nearest neighbors
+def xq: Array[Float]({1.5, 2.5, 3.5, 4.5});
+def labels: array[Int[64], 3];
+def distances: array[Float, 3];
+index.search(1, xq.buf, 3, distances, labels); // Find 3 nearest neighbors
+
+// Clean up
+Index.free(index);
+```
+
+
+
+انظر الأمثلة الكاملة في مجلد `Examples/`.
+
+## التوثيق
+
+تلتف هذه المكتبة حول واجهة FAISS البرمجية بلغة C. للحصول على توثيق مفصل حول المفاهيم والخوارزميات وأفضل الممارسات، يرجى الرجوع إلى التوثيق الرسمي لـ FAISS:
+
+- **التوثيق الرئيسي**: https://github.com/facebookresearch/faiss/wiki
+- **مرجع واجهة C البرمجية**: https://github.com/facebookresearch/faiss/blob/main/c_api/
+- **دليل البدء**: https://github.com/facebookresearch/faiss/wiki/Getting-started
+- **دليل اختيار الفهرس**: https://github.com/facebookresearch/faiss/wiki/Guidelines-to-choose-an-index
+
+## مرجع الواجهة البرمجية
+
+### الأصناف الأساسية
+
+#### فـهرس / Index
+الصنف الرئيسي للبحث عن التشابه. [توثيق واجهة C البرمجية](https://github.com/facebookresearch/faiss/blob/main/c_api/Index_c.h)
+
+**دالة المصنع:**
+- `أنشئ` / `new`
+ ```alusus
+ فـهرس.أنشئ(الكائن: سند[سند[فـهرس]]، ب: صـحيح، وصف: مـؤشر_محارف، نوع_القياس: صـحيح): صـحيح
+ ```
+
+
+
+ ```alusus
+ Index.new(obj: ref[ref[Index]]، d: Int، وصف: CharsPtr، metric: Int): Int
+ ```
+
+
+
+ إنشاء فهرس باستخدام نص المصنع
+
+**الدوال الرئيسية:**
+- `درب` / `train`
+ ```alusus
+ فـهرس.درب(n: صـحيح[64]، x: سند[مصفوفة[عـائم]]): صـحيح
+ ```
+
+
+
+ ```alusus
+ Index.train(n: Int[64]، x: ref[array[Float]]): Int
+ ```
+
+
+
+ تدريب الفهرس على البيانات
+
+- `أضف` / `add`
+ ```alusus
+ فـهرس.أضف(n: صـحيح[64]، x: سند[مصفوفة[عـائم]]): صـحيح
+ ```
+
+
+
+ ```alusus
+ Index.add(n: Int[64]، x: ref[array[Float]]): Int
+ ```
+
+
+
+ إضافة متجهات إلى الفهرس
+
+- `ابحث` / `search`
+ ```alusus
+ فـهرس.ابحث(n: صـحيح[64]، x: سند[مصفوفة[عـائم]]، k: صـحيح[64]،
+ مسافات: سند[مصفوفة[عـائم]]، labels: سند[مصفوفة[صـحيح[64]]]
+ ): صـحيح
+ ```
+
+
+
+ ```alusus
+ Index.search(n: Int[64]، x: ref[array[Float]]، k: Int[64]،
+ distances: ref[array[Float]]، labels: ref[array[Int[64]]]
+ ): Int
+ ```
+
+
+
+ البحث عن k من أقرب الجيران
+
+- `بحث_المدى` / `rangeSearch`
+ ```alusus
+ فـهرس.بحث_المدى(n: صـحيح[64]، x: سند[مصفوفة[عـائم]]، radius: عـائم،
+ result: سند[نـتيجة_بحث_مدى]): صـحيح
+ ```
+
+
+
+ ```alusus
+ Index.rangeSearch(n: Int[64], x: ref[array[Float]], radius: Float,
+ result: ref[RangeSearchResult]): Int
+ ```
+
+
+
+ البحث بنطاق
+
+- `أعد_الضبط` / `reset`
+ ```alusus
+ فـهرس.أعد_الضبط(): صـحيح
+ ```
+
+
+
+ ```alusus
+ Index.reset(): Int
+ ```
+
+
+
+ إزالة جميع المتجهات من الفهرس
+
+- `احذف_المعرفات` / `removeIds`
+ ```alusus
+ فـهرس.احذف_المعرفات(sel: سند[مـنتقي_معرف]، nRemoved: سند[كلمة_معمارية]): صـحيح
+ ```
+
+
+
+ ```alusus
+ Index.removeIds(sel: ref[IdSelector], nRemoved: ref[ArchWord]): Int
+ ```
+
+
+
+ إزالة متجهات محددة
+
+**الخصائص:**
+- `البعد` / `d`: `صحيح[64]` - بُعد المتجه
+- `العدد_الكلي` / `nTotal`: `صحيح[64]` - العدد الإجمالي للمتجهات المفهرسة
+- `مدرب` / `isTrained`: `صحيح` - ما إذا كان الفهرس مدرباً (0 أو 1)
+- `نوع_القياس` / `metricType`: `نـوع_قياس` - مقياس المسافة المستخدم
+- `إطناب` / `verbose`: `صحيح` - مستوى الإسهاب
+
+**التنظيف:**
+- `حرر` / `free`
+ ```alusus
+ فـهرس.حرر(obj: سند[فـهرس])
+ ```
+
+
+
+ ```alusus
+ Index.free(obj: ref[Index])
+ ```
+
+
+
+ تحرير ذاكرة الفهرس
+
+#### فـهرس_مسطح / IndexFlat
+فهرس القوة الغاشمة الذي يقوم بالبحث الدقيق. [دليل](https://github.com/facebookresearch/faiss/wiki/Faiss-indexes#flat-indexes)
+
+**الإنشاء:**
+- `أنشئ` / `new`
+ ```alusus
+ فـهرس_مسطح.أنشئ(obj: سند[سند[فـهرس_مسطح]]): صـحيح
+ فـهرس_مسطح.أنشئ(obj: سند[سند[فـهرس_مسطح]]، d: صـحيح[64]، metric: نـوع_قياس): صـحيح
+ ```
+
+
+
+ ```alusus
+ IndexFlat.new(obj: ref[ref[IndexFlat]]): Int
+ IndexFlat.new(obj: ref[ref[IndexFlat]], d: Int[64], metric: MetricType): Int
+ ```
+
+
+
+**دوال إضافية:**
+- `هات_البيانات` / `getXb`
+ ```alusus
+ فـهرس_مسطح.هات_البيانات(outXb: سند[سند[مصفوفة[عـائم]]]، outSize: سند[كلمة_معمارية])
+ ```
+
+
+
+ ```alusus
+ IndexFlat.getXb(outXb: ref[ref[array[Float]]], outSize: ref[ArchWord])
+ ```
+
+
+
+ الحصول على المتجهات المخزنة
+
+- `احسب_مسافة_مجموعة_جزئية` / `computeDistanceSubset`
+ ```alusus
+ فـهرس_مسطح.احسب_مسافة_مجموعة_جزئية(n: صـحيح[64]، x: سند[مصفوفة[عـائم]]، k: صـحيح[64]،
+ outDistances: سند[مصفوفة[عـائم]]، labels: سند[مصفوفة[صـحيح[64]]]): صـحيح
+ ```
+
+
+
+ ```alusus
+ IndexFlat.computeDistanceSubset(n: Int[64], x: ref[array[Float]], k: Int[64],
+ outDistances: ref[array[Float]], labels: ref[array[Int[64]]]): Int
+ ```
+
+
+
+ حساب المسافات إلى مجموعة جزئية
+
+يرث جميع دوال فـهرس / Index.
+
+#### فـهرس_مسطح_آيبي / IndexFlatIp
+فهرس مسطح متخصص لمقياس الجداء الداخلي. [توثيق](https://github.com/facebookresearch/faiss/wiki/MetricType-and-distances)
+
+**الإنشاء:**
+- `أنشئ` / `new`
+ ```alusus
+ فـهرس_مسطح_آيبي.أنشئ(obj: سند[سند[فـهرس_مسطح_آيبي]]): صـحيح
+ فـهرس_مسطح_آيبي.أنشئ(obj: سند[سند[فـهرس_مسطح_آيبي]]، d: صـحيح[64]): صـحيح
+ ```
+
+
+
+ ```alusus
+ IndexFlatIp.new(obj: ref[ref[IndexFlatIp]]): Int
+ IndexFlatIp.new(obj: ref[ref[IndexFlatIp]], d: Int[64]): Int
+ ```
+
+
+
+#### فـهرس_مسطح_ل2 / IndexFlatL2
+فهرس مسطح متخصص لمسافة L2 (إقليدس). [توثيق](https://github.com/facebookresearch/faiss/wiki/MetricType-and-distances)
+
+**الإنشاء:**
+- `أنشئ` / `new`
+ ```alusus
+ فـهرس_مسطح_ل2.أنشئ(obj: سند[سند[فـهرس_مسطح_ل2]]): صـحيح
+ فـهرس_مسطح_ل2.أنشئ(obj: سند[سند[فـهرس_مسطح_ل2]]، d: صـحيح[64]): صـحيح
+ ```
+
+
+
+ ```alusus
+ IndexFlatL2.new(obj: ref[ref[IndexFlatL2]]): Int
+ IndexFlatL2.new(obj: ref[ref[IndexFlatL2]], d: Int[64]): Int
+ ```
+
+
+
+#### فـهرس_ملف_معكوس / IndexIvf
+فهرس الملفات المعكوسة للبحث التقريبي الأسرع. [دليل](https://github.com/facebookresearch/faiss/wiki/Faiss-indexes#cell-probe-methods-indexivf-indexes)
+
+**خصائص إضافية:**
+- `عدد_القوائم` / `nList`: `كلمة_معمارية` - عدد القوائم المعكوسة (العناقيد)
+- `عدد_الاستقصاءات` / `nProbe`: `كلمة_معمارية` - عدد العناقيد المراد زيارتها أثناء البحث (قابل للضبط)
+- `المكمم` / `quantizer`: `سند[فـهرس]` - فهرس المكمم
+- `يمتلك_الحقول` / `ownFields`: `صحيح` - ما إذا كان الفهرس يمتلك حقوله
+
+**دوال إضافية:**
+- `ادمج_من` / `mergeFrom`
+ ```alusus
+ فـهرس_ملف_معكوس.ادمج_من(other: سند[فـهرس_ملف_معكوس]، addId: صـحيح[64]): صـحيح
+ ```
+
+
+
+ ```alusus
+ IndexIvf.mergeFrom(other: ref[IndexIvf], addId: Int[64]): Int
+ ```
+
+
+
+ دمج فهرس IVF آخر
+
+- `انسخ_مجموعة_جزئية_إلى` / `copySubsetTo`
+ ```alusus
+ فـهرس_ملف_معكوس.انسخ_مجموعة_جزئية_إلى(other: سند[فـهرس_ملف_معكوس]، subsetType: صـحيح، a1: صـحيح[64]، a2: صـحيح[64]): صـحيح
+ ```
+
+
+
+ ```alusus
+ IndexIvf.copySubsetTo(other: ref[IndexIvf], subsetType: Int, a1: Int[64], a2: Int[64]): Int
+ ```
+
+
+
+ نسخ مجموعة جزئية من المتجهات
+
+- `هات_حجم_القائمة` / `getListSize`
+ ```alusus
+ فـهرس_ملف_معكوس.هات_حجم_القائمة(listNo: كلمة_معمارية): كلمة_معمارية
+ ```
+
+
+
+ ```alusus
+ IndexIvf.getListSize(listNo: ArchWord): ArchWord
+ ```
+
+
+
+ الحصول على حجم القائمة المعكوسة
+
+- `اصنع_تعيينا_مباشرا` / `makeDirectMap`
+ ```alusus
+ فـهرس_ملف_معكوس.اصنع_تعيينا_مباشرا(newMaintainDirectMap: صـحيح): صـحيح
+ ```
+
+
+
+ ```alusus
+ IndexIvf.makeDirectMap(newMaintainDirectMap: Int): Int
+ ```
+
+
+
+ إنشاء خريطة مباشرة لإعادة البناء
+
+- `عامل_عدم_التوازن` / `imbalanceFactor`: `عـائم[64]` - الحصول على عامل عدم توازن العناقيد
+- `اطبع_الإحصائيات` / `printStats`: `()` - طباعة إحصائيات الفهرس
+
+#### فـهرس_ثنائي / IndexBinary
+فهرس للمتجهات الثنائية (هامينغ). [دليل](https://github.com/facebookresearch/faiss/wiki/Binary-indexes)
+
+مشابه لـ فـهرس / Index ولكنه يعمل على المتجهات الثنائية (مصفوفات Word[8] بدلاً من Float).
+
+### الأصناف الداعمة
+
+#### فـضاء_وسيط / ParameterSpace
+إدارة معاملات الفهرس للبحث الشبكي والضبط. [واجهة C البرمجية](https://github.com/facebookresearch/faiss/blob/main/c_api/ParameterSpace_c.h)
+
+**الدوال:**
+- `أنشئ` / `new`
+ ```alusus
+ فـضاء_وسيط.أنشئ(parameterSpace: سند[سند[فـضاء_وسيط]]): صـحيح
+ ```
+
+
+
+ ```alusus
+ ParameterSpace.new(parameterSpace: ref[ref[ParameterSpace]]): Int
+ ```
+
+
+
+- `حدد_وسيط_فهرس` / `setIndexParameter`
+ ```alusus
+ فـضاء_وسيط.حدد_وسيط_فهرس(index: سند[فـهرس]، paramName: مـؤشر_محارف، val: عـائم[64]): صـحيح
+ ```
+
+
+
+ ```alusus
+ ParameterSpace.setIndexParameter(index: ref[Index], paramName: CharsPtr, val: Float[64]): Int
+ ```
+
+
+
+ تعيين معامل واحد
+
+- `حدد_وسطاء_فهرس` / `setIndexParameters`
+ ```alusus
+ فـضاء_وسيط.حدد_وسطاء_فهرس(index: سند[فـهرس]، params: مـؤشر_محارف): صـحيح
+ ```
+
+
+
+ ```alusus
+ ParameterSpace.setIndexParameters(index: ref[Index], params: CharsPtr): Int
+ ```
+
+
+
+ تعيين معاملات متعددة
+
+- `أضف_مدى` / `addRange`
+ ```alusus
+ فـضاء_وسيط.أضف_مدى(name: مـؤشر_محارف، outRange: سند[سند[مـدى_وسيط]]): صـحيح
+ ```
+
+
+
+ ```alusus
+ ParameterSpace.addRange(name: CharsPtr, outRange: ref[ref[ParameterRange]]): Int
+ ```
+
+
+
+ إضافة نطاق معامل
+
+#### وسـطاء_بحث / SearchParameters
+معاملات البحث في وقت التشغيل. [واجهة C البرمجية](https://github.com/facebookresearch/faiss/blob/main/c_api/Index_c.h)
+
+**الدوال:**
+- `أنشئ` / `new`
+ ```alusus
+ وسـطاء_بحث.أنشئ(obj: سند[سند[وسـطاء_بحث]]، sel: سند[مـنتقي_معرف]): صـحيح
+ ```
+
+
+
+ ```alusus
+ SearchParameters.new(obj: ref[ref[SearchParameters]], sel: ref[IdSelector]): Int
+ ```
+
+
+
+- `عدد_الاستقصاءات` / `nProbe`: `صحيح` - عدد العناقيد المراد استقصاءها (لفهارس IVF)
+
+#### وسـطاء_بحث_ملف_معكوس / SearchParametersIvf
+معاملات بحث موسعة لفهارس IVF.
+
+**الدوال:**
+- `أنشئ` / `new`
+ ```alusus
+ وسـطاء_بحث_ملف_معكوس.أنشئ(obj: سند[سند[وسـطاء_بحث_ملف_معكوس]]): صـحيح
+ وسـطاء_بحث_ملف_معكوس.أنشئ(obj: سند[سند[وسـطاء_بحث_ملف_معكوس]]، sel: سند[مـنتقي_معرف]،
+ nprobe: كلمة_معمارية، maxCodes: كلمة_معمارية): صـحيح
+ ```
+
+
+
+ ```alusus
+ SearchParametersIvf.new(obj: ref[ref[SearchParametersIvf]]): Int
+ SearchParametersIvf.new(obj: ref[ref[SearchParametersIvf]], sel: ref[IdSelector],
+ nprobe: ArchWord, maxCodes: ArchWord): Int
+ ```
+
+
+
+**الخصائص:**
+- `المنتقي` / `sel`: `سند[مـنتقي_معرف]` - منتقي المعرف
+- `عدد_الاستقصاءات` / `nProbe`: `كلمة_معمارية` - عدد العناقيد المراد استقصاءها
+- `أقصى_شفرات` / `maxCodes`: `كلمة_معمارية` - الحد الأقصى للشفرات المراد فحصها
+
+#### تـجميع / Clustering
+تطبيق تجميع K-means. [واجهة C البرمجية](https://github.com/facebookresearch/faiss/blob/main/c_api/Clustering_c.h)
+
+**الإنشاء:**
+- `أنشئ` / `new`
+ ```alusus
+ تـجميع.أنشئ(out: سند[سند[تـجميع]]، d: صـحيح، k: صـحيح): صـحيح
+ تـجميع.أنشئ(out: سند[سند[تـجميع]]، d: صـحيح، k: صـحيح، params: مؤشر[وسـطاء_تجميع]): صـحيح
+ ```
+
+
+
+ ```alusus
+ Clustering.new(out: ref[ref[Clustering]], d: Int, k: Int): Int
+ Clustering.new(out: ref[ref[Clustering]], d: Int, k: Int, params: ptr[ClusteringParameters]): Int
+ ```
+
+
+
+**الدوال:**
+- `درب` / `train`
+ ```alusus
+ تـجميع.درب(n: صـحيح[64]، x: سند[عـائم]، index: سند[فـهرس]): صـحيح
+ ```
+
+
+
+ ```alusus
+ Clustering.train(n: Int[64], x: ref[Float], index: ref[Index]): Int
+ ```
+
+
+
+ تشغيل k-means
+
+- `هات_المراكز` / `getCentroids`
+ ```alusus
+ تـجميع.هات_المراكز(centroids: سند[سند[مصفوفة[عـائم]]]، size: سند[كلمة_معمارية])
+ ```
+
+
+
+ ```alusus
+ Clustering.getCentroids(centroids: ref[ref[array[Float]]], size: ref[ArchWord])
+ ```
+
+
+
+ الحصول على مراكز العناقيد
+
+- `هات_إحصائيات_الدورة` / `getIterationStats`
+ ```alusus
+ تـجميع.هات_إحصائيات_الدورة(stats_out: سند[سند[إحـصائيات_دورة_تجميع]]، size: سند[كلمة_معمارية])
+ ```
+
+
+
+ ```alusus
+ Clustering.getIterationStats(stats_out: ref[ref[ClusteringIterationStats]], size: ref[ArchWord])
+ ```
+
+
+
+ الحصول على إحصائيات التكرار
+
+**الخصائص:**
+- `عدد_الدورات` / `niter`: `صحيح` - عدد التكرارات
+- `عدد_الإعادات` / `nredo`: `صحيح` - عدد إعادات k-means
+- `عدد_المراكز` / `k`: `كلمة_معمارية` - عدد العناقيد
+- `البعد` / `d`: `كلمة_معمارية` - بُعد المتجه
+
+#### مـنتقي_معرف / IdSelector
+اختيار مجموعات فرعية من المتجهات حسب المعرف. [واجهة C البرمجية](https://github.com/facebookresearch/faiss/blob/main/c_api/Index_c.h)
+
+**الأنواع:**
+- `مـنتقي_معرف_حزمة` / `IdSelectorBatch` - اختيار معرفات محددة من قائمة
+- `مـنتقي_معرف_مدى` / `IdSelectorRange` - اختيار المعرفات في نطاق
+- `مـنتقي_معرف_بتماب` / `IdSelectorBitmap` - الاختيار باستخدام خريطة بت
+- `مـنتقي_معرف_نفي` / `IdSelectorNot` - عكس منتقي
+- `مـنتقي_معرف_و` / `IdSelectorAnd` - دمج المنتقيات بـ AND
+- `مـنتقي_معرف_أو` / `IdSelectorOr` - دمج المنتقيات بـ OR
+- `مـنتقي_معرف_أو_حصري` / `IdSelectorXor` - دمج المنتقيات بـ XOR
+
+#### نـتيجة_بحث_مدى / RangeSearchResult
+نتائج استعلامات البحث بنطاق. [واجهة C البرمجية](https://github.com/facebookresearch/faiss/blob/main/c_api/Index_c.h)
+
+**الدوال:**
+- `أنشئ` / `new`
+ ```alusus
+ نـتيجة_بحث_مدى.أنشئ(obj: سند[سند[نـتيجة_بحث_مدى]]، nq: صـحيح[64]): صـحيح
+ ```
+
+
+
+ ```alusus
+ RangeSearchResult.new(obj: ref[ref[RangeSearchResult]], nq: Int[64]): Int
+ ```
+
+
+
+- `نفذ_التخصيص` / `doAllocation`
+ ```alusus
+ نـتيجة_بحث_مدى.نفذ_التخصيص(): صـحيح
+ ```
+
+
+
+ ```alusus
+ RangeSearchResult.doAllocation(): Int
+ ```
+
+
+
+ تخصيص صوانات النتائج
+
+- `حجم_الصوان` / `bufferSize`
+ ```alusus
+ نـتيجة_بحث_مدى.حجم_الصوان(): كلمة_معمارية
+ ```
+
+
+
+ ```alusus
+ RangeSearchResult.bufferSize(): ArchWord
+ ```
+
+
+
+ الحصول على حجم الصوان
+
+- `هات_الحدود` / `getLims`
+ ```alusus
+ نـتيجة_بحث_مدى.هات_الحدود(outLims: سند[سند[مصفوفة[كلمة_معمارية]]])
+ ```
+
+
+
+ ```alusus
+ RangeSearchResult.getLims(outLims: ref[ref[array[ArchWord]]])
+ ```
+
+
+
+ الحصول على مصفوفة حدود النتائج
+
+- `هات_الوسوم` / `getLabels`
+ ```alusus
+ نـتيجة_بحث_مدى.هات_الوسوم(outLabels: سند[سند[مصفوفة[صـحيح[64]]]]، outDistances: سند[سند[سند[عـائم]]])
+ ```
+
+
+
+ ```alusus
+ RangeSearchResult.getLabels(outLabels: ref[ref[array[Int[64]]]], outDistances: ref[ref[ref[Float]]])
+ ```
+
+
+
+ الحصول على الوسوم والمسافات
+
+#### حـاسب_مسافة / DistanceComputer
+حساب المسافات إلى المتجهات. [واجهة C البرمجية](https://github.com/facebookresearch/faiss/blob/main/c_api/Index_c.h)
+
+**الدوال:**
+- `حدد_الاستعلام` / `setQuery`
+ ```alusus
+ حـاسب_مسافة.حدد_الاستعلام(x: سند[مصفوفة[عـائم]]): صـحيح
+ ```
+
+
+
+ ```alusus
+ DistanceComputer.setQuery(x: ref[array[Float]]): Int
+ ```
+
+
+
+ تعيين متجه الاستعلام
+
+- `مسافة_متجه_للاستعلام` / `vectorToQueryDis`
+ ```alusus
+ حـاسب_مسافة.مسافة_متجه_للاستعلام(i: صـحيح[64]، qd: سند[مصفوفة[عـائم]]): صـحيح
+ ```
+
+
+
+ ```alusus
+ DistanceComputer.vectorToQueryDis(i: Int[64], qd: ref[array[Float]]): Int
+ ```
+
+
+
+ المسافة إلى الاستعلام
+
+- `مسافة_متماثلة` / `symmetricDis`
+ ```alusus
+ حـاسب_مسافة.مسافة_متماثلة(i: صـحيح[64]، j: صـحيح[64]، vd: سند[مصفوفة[عـائم]]): صـحيح
+ ```
+
+
+
+ ```alusus
+ DistanceComputer.symmetricDis(i: Int[64], j: Int[64], vd: ref[array[Float]]): Int
+ ```
+
+
+
+ المسافة المتماثلة
+
+### الثوابت
+
+#### نـوع_قياس / MetricType
+مقاييس المسافة. [توثيق](https://github.com/facebookresearch/faiss/wiki/MetricType-and-distances)
+
+- `_نتاج_داخلي_` / `METRIC_INNER_PRODUCT`: `0` - الجداء الداخلي (أقصى تشابه)
+- `_ل2_` / `METRIC_L2`: `1` - المسافة الإقليدية (معيار L2)
+- `_ل1_` / `METRIC_L1`: `2` - مسافة مانهاتن (معيار L1)
+- `_ل8_` / `METRIC_LINF`: `3` - معيار اللانهاية (مسافة تشيبيشيف)
+- `_لس_` / `METRIC_LP`: `4` - معيار Lp
+- `_كانبيرا_` / `METRIC_CANBERRA`: `20` - مسافة كانبيرا
+- `_براي_كرتس_` / `METRIC_BRAY_CURTIS`: `21` - تباين براي-كورتس
+- `_جنسن_شانون_` / `METRIC_JENSEN_SHANNON`: `22` - تباعد جينسن-شانون
+
+#### رمـز_خطأ / ErrorCode
+رموز الإرجاع من دوال واجهة C البرمجية.
+
+- `_نجاح_` / `OK`: `0` - نجاح
+- `_استثناء_مجهول_` / `UNKNOWN_EXCEPT`: `-1` - استثناء غير معروف
+- `_استثناء_فيس_` / `FAISS_EXCEPT`: `-2` - استثناء FAISS
+- `_استثناء_قياسي_` / `STD_EXCEPT`: `-4` - استثناء المكتبة القياسية
+
+### الدوال
+
+- `هات_آخر_خطأ` / `getLastError`
+ ```alusus
+ فـيس.هات_آخر_خطأ(): مـؤشر_محارف
+ ```
+
+
+
+ ```alusus
+ Faiss.getLastError(): CharsPtr
+ ```
+
+
+
+ الحصول على رسالة الخطأ الأخيرة
+
+- `تجميع_كيمينز` / `kmeansClustering`
+ ```alusus
+ فـيس.تجميع_كيمينز(d: كلمة_معمارية، n: كلمة_معمارية، k: كلمة_معمارية،
+ x: سند[مصفوفة[عـائم]]، centroids: سند[مصفوفة[عـائم]]، q_error: سند[عـائم]): صـحيح
+ ```
+
+
+
+ ```alusus
+ Faiss.kmeansClustering(d: ArchWord, n: ArchWord, k: ArchWord,
+ x: ref[array[Float]], centroids: ref[array[Float]], q_error: ref[Float]): Int
+ ```
+
+
+
+ k-means مستقل
+
+## دعم GPU
+
+لتفعيل تسريع GPU، قم بتعيين متغير البيئة قبل التشغيل:
+```bash
+export FAISS_USE_GPU=1
+```
+
+ستقوم المكتبة تلقائياً بتحميل الملفات الثنائية المفعّلة لـ GPU عند توفرها. راجع [توثيق FAISS GPU](https://github.com/facebookresearch/faiss/wiki/Faiss-on-the-GPU) للتفاصيل.
+
+## نصوص مصنع الفهرس
+
+تقبل دالة المصنع `أنشئ` / `new` نصوصاً لإنشاء أنواع فهرس مختلفة:
+
+- `"Flat"` - بحث دقيق (قوة غاشمة)
+- `"IVFn,Flat"` - IVF مع n مركز، ترميز مسطح
+- `"IVFn,PQm"` - IVF مع n مركز، PQ مع m مكمّم فرعي
+- `"HNSW32"` - عالم صغير قابل للتنقل الهرمي مع 32 جار
+- `"IVFn,HNSW32"` - IVF و HNSW مدمجان
+
+راجع [توثيق مصنع الفهرس](https://github.com/facebookresearch/faiss/wiki/The-index-factory) لجميع الخيارات والتوليفات المتاحة.
+
+## الأمثلة
+
+أمثلة عمل كاملة في مجلد `Examples/`:
+
+- **مثال.أسس** - فهرس مسطح أساسي مع بحث الجداء الداخلي (عربي)
+- **مثال٢.أسس** - فهرس IVF مع ضبط المعاملات (عربي)
+- **example.alusus** - فهرس مسطح أساسي مع بحث الجداء الداخلي (إنجليزي)
+- **example2.alusus** - فهرس IVF مع ضبط المعاملات (إنجليزي)
+
+## نصائح الأداء
+
+1. **اختيار الفهرس**:
+ - استخدم `فـهرس_مسطح` / `IndexFlat` للبحث الدقيق في مجموعات البيانات <1 مليون متجه
+ - استخدم `فـهرس_ملف_معكوس` / `IndexIVF` للبحث التقريبي في مجموعات البيانات الأكبر
+ - راجع [دليل اختيار الفهرس](https://github.com/facebookresearch/faiss/wiki/Guidelines-to-choose-an-index)
+
+2. **التدريب**: تتطلب فهارس IVF والفهارس التقريبية الأخرى التدريب قبل إضافة المتجهات
+
+3. **معامل nprobe**: بالنسبة لفهارس IVF، nprobe أعلى = دقة أفضل ولكن بحث أبطأ
+
+4. **تسريع GPU**: فعّل GPU للعمليات على >10 مليون متجه
+
+5. **الذاكرة**: تخزّن الفهارس المسطحة جميع المتجهات في الذاكرة؛ استخدم الضغط لمجموعات البيانات الكبيرة
+
+راجع [إرشادات أداء FAISS](https://github.com/facebookresearch/faiss/wiki/Lower-memory-footprint) للتوصيات التفصيلية.
+
+## موارد إضافية
+
+- **FAISS على GitHub**: https://github.com/facebookresearch/faiss
+- **ويكي FAISS**: https://github.com/facebookresearch/faiss/wiki
+- **ورقة بحثية**: [البحث عن التشابه بمليارات المقاييس مع GPUs](https://arxiv.org/abs/1702.08734)
+- **لغة الأسس**: https://alusus.org
+
+## الترخيص
+
+تتبع هذه الروابط ترخيص FAISS (MIT). راجع ملف `license` للتفاصيل.
+
+
+
diff --git a/readme.md b/readme.md
new file mode 100644
index 0000000..4f6f1f6
--- /dev/null
+++ b/readme.md
@@ -0,0 +1,293 @@
+# Faiss
+[[العربية]](readme.ar.md)
+
+Alusus language bindings for the [FAISS library](https://github.com/facebookresearch/faiss) - A library for efficient similarity search and clustering of dense vectors.
+
+## Overview
+
+This library provides Alusus bindings to FAISS, enabling high-performance vector similarity search and clustering operations in the Alusus programming language.
+
+## Installation
+
+```alusus
+import "Apm";
+Apm.importFile("Alusus/Faiss");
+use Faiss;
+```
+
+## Quick Start
+
+```alusus
+import "Srl/Console";
+import "Srl/Array";
+import "Apm";
+Apm.importFile("Alusus/Faiss");
+use Srl;
+use Faiss;
+
+// Create a flat index with 4-dimensional vectors
+def index: ref[Index];
+Index.new(index, 4, "Flat", MetricType.METRIC_INNER_PRODUCT);
+
+// Add vectors to the index
+def xb: Array[Float]({1.0, 2.0, 3.0, 4.0, 2.0, 3.0, 4.0, 5.0});
+index.add(2, xb.buf); // 2 vectors
+
+// Search for nearest neighbors
+def xq: Array[Float]({1.5, 2.5, 3.5, 4.5});
+def labels: array[Int[64], 3];
+def distances: array[Float, 3];
+index.search(1, xq.buf, 3, distances, labels); // Find 3 nearest neighbors
+
+// Clean up
+Index.free(index);
+```
+
+See complete examples in the `Examples/` directory.
+
+## Documentation
+
+This library wraps the FAISS C API. For detailed documentation of concepts, algorithms, and best practices, please refer to the official FAISS documentation:
+
+- **Main Documentation**: https://github.com/facebookresearch/faiss/wiki
+- **C API Reference**: https://github.com/facebookresearch/faiss/blob/main/c_api/
+- **Getting Started Tutorial**: https://github.com/facebookresearch/faiss/wiki/Getting-started
+- **Index Selection Guide**: https://github.com/facebookresearch/faiss/wiki/Guidelines-to-choose-an-index
+
+## API Reference
+
+### Core Classes
+
+#### Index
+Main index class for similarity search. [C API docs](https://github.com/facebookresearch/faiss/blob/main/c_api/Index_c.h)
+
+**Factory method:**
+- `Index.new(obj: ref[ref[Index]], d: Int, description: CharsPtr, metric: Int): Int` - Create index using factory string
+
+**Key methods:**
+- `train(n: Int[64], x: ref[array[Float]]): Int` - Train the index on data
+- `add(n: Int[64], x: ref[array[Float]]): Int` - Add vectors to index
+- `search(n: Int[64], x: ref[array[Float]], k: Int[64], distances: ref[array[Float]], labels: ref[array[Int[64]]]): Int` - Search for k nearest neighbors
+- `rangeSearch(n: Int[64], x: ref[array[Float]], radius: Float, result: ref[RangeSearchResult]): Int` - Range search
+- `reset(): Int` - Remove all vectors from index
+- `removeIds(sel: ref[IdSelector], nRemoved: ref[ArchWord]): Int` - Remove specific vectors
+
+**Properties:**
+- `d: Int[64]` - Vector dimension
+- `nTotal: Int[64]` - Total number of indexed vectors
+- `isTrained: Int` - Whether index is trained (0 or 1)
+- `metricType: MetricType` - Distance metric being used
+- `verbose: Int` - Verbosity level
+
+**Cleanup:**
+- `Index.free(obj: ref[Index])` - Free index memory
+
+#### IndexFlat
+Brute-force index performing exact search. [Guide](https://github.com/facebookresearch/faiss/wiki/Faiss-indexes#flat-indexes)
+
+**Creation:**
+- `IndexFlat.new(obj: ref[ref[IndexFlat]]): Int`
+- `IndexFlat.new(obj: ref[ref[IndexFlat]], d: Int[64], metric: MetricType): Int`
+
+**Additional methods:**
+- `getXb(outXb: ref[ref[array[Float]]], outSize: ref[ArchWord])` - Get stored vectors
+- `computeDistanceSubset(n: Int[64], x: ref[array[Float]], k: Int[64], outDistances: ref[array[Float]], labels: ref[array[Int[64]]]): Int` - Compute distances to subset
+
+Inherits all Index methods.
+
+#### IndexFlatIp
+Flat index specialized for inner product metric. [Docs](https://github.com/facebookresearch/faiss/wiki/MetricType-and-distances)
+
+**Creation:**
+- `IndexFlatIp.new(obj: ref[ref[IndexFlatIp]]): Int`
+- `IndexFlatIp.new(obj: ref[ref[IndexFlatIp]], d: Int[64]): Int`
+
+#### IndexFlatL2
+Flat index specialized for L2 (Euclidean) distance. [Docs](https://github.com/facebookresearch/faiss/wiki/MetricType-and-distances)
+
+**Creation:**
+- `IndexFlatL2.new(obj: ref[ref[IndexFlatL2]]): Int`
+- `IndexFlatL2.new(obj: ref[ref[IndexFlatL2]], d: Int[64]): Int`
+
+#### IndexIvf
+Inverted file index for faster approximate search. [Guide](https://github.com/facebookresearch/faiss/wiki/Faiss-indexes#cell-probe-methods-indexivf-indexes)
+
+**Additional properties:**
+- `nList: ArchWord` - Number of inverted lists (clusters)
+- `nProbe: ArchWord` - Number of clusters to visit during search (tunable)
+- `quantizer: ref[Index]` - Quantizer index
+- `ownFields: Int` - Whether index owns its fields
+
+**Additional methods:**
+- `mergeFrom(other: ref[IndexIvf], addId: Int[64]): Int` - Merge another IVF index
+- `copySubsetTo(other: ref[IndexIvf], subsetType: Int, a1: Int[64], a2: Int[64]): Int` - Copy subset of vectors
+- `getListSize(listNo: ArchWord): ArchWord` - Get size of inverted list
+- `makeDirectMap(newMaintainDirectMap: Int): Int` - Create direct map for reconstruction
+- `imbalanceFactor: Float[64]` - Get cluster imbalance factor
+- `printStats()` - Print index statistics
+
+#### IndexBinary
+Index for binary (hamming) vectors. [Guide](https://github.com/facebookresearch/faiss/wiki/Binary-indexes)
+
+Similar to Index but operates on binary vectors (Word[8] arrays instead of Float arrays).
+
+### Support Classes
+
+#### ParameterSpace
+Manages index parameters for grid search and tuning. [C API](https://github.com/facebookresearch/faiss/blob/main/c_api/ParameterSpace_c.h)
+
+**Methods:**
+- `new(parameterSpace: ref[ref[ParameterSpace]]): Int`
+- `setIndexParameter(index: ref[Index], paramName: CharsPtr, val: Float[64]): Int` - Set single parameter
+- `setIndexParameters(index: ref[Index], params: CharsPtr): Int` - Set multiple parameters
+- `addRange(name: CharsPtr, outRange: ref[ref[ParameterRange]]): Int` - Add parameter range
+
+#### SearchParameters
+Runtime search parameters. [C API](https://github.com/facebookresearch/faiss/blob/main/c_api/Index_c.h)
+
+**Methods:**
+- `new(obj: ref[ref[SearchParameters]], sel: ref[IdSelector]): Int`
+- `nProbe: Int` - Number of clusters to probe (for IVF indexes)
+
+#### SearchParametersIvf
+Extended search parameters for IVF indexes.
+
+**Methods:**
+- `new(obj: ref[ref[SearchParametersIvf]]): Int`
+- `new(obj: ref[ref[SearchParametersIvf]], sel: ref[IdSelector], nprobe: ArchWord, maxCodes: ArchWord): Int`
+
+**Properties:**
+- `sel: ref[IdSelector]` - ID selector
+- `nProbe: ArchWord` - Number of clusters to probe
+- `maxCodes: ArchWord` - Maximum codes to scan
+
+#### Clustering
+K-means clustering implementation. [C API](https://github.com/facebookresearch/faiss/blob/main/c_api/Clustering_c.h)
+
+**Creation:**
+- `new(out: ref[ref[Clustering]], d: Int, k: Int): Int` - Create with dimension and k clusters
+- `new(out: ref[ref[Clustering]], d: Int, k: Int, params: ptr[ClusteringParameters]): Int` - Create with parameters
+
+**Methods:**
+- `train(n: Int[64], x: ref[Float], index: ref[Index]): Int` - Run k-means
+- `getCentroids(centroids: ref[ref[array[Float]]], size: ref[ArchWord])` - Get cluster centroids
+- `getIterationStats(stats_out: ref[ref[ClusteringIterationStats]], size: ref[ArchWord])` - Get iteration statistics
+
+**Properties:**
+- `niter: Int` - Number of iterations
+- `nredo: Int` - Number of k-means restarts
+- `k: ArchWord` - Number of clusters
+- `d: ArchWord` - Vector dimension
+
+#### IdSelector
+Select subsets of vectors by ID. [C API](https://github.com/facebookresearch/faiss/blob/main/c_api/Index_c.h)
+
+**Variants:**
+- `IdSelectorBatch` - Select specific IDs from a list
+- `IdSelectorRange` - Select IDs in a range
+- `IdSelectorBitmap` - Select using a bitmap
+- `IdSelectorNot` - Invert a selector
+- `IdSelectorAnd` - Combine selectors with AND
+- `IdSelectorOr` - Combine selectors with OR
+- `IdSelectorXor` - Combine selectors with XOR
+
+#### RangeSearchResult
+Results from range search queries. [C API](https://github.com/facebookresearch/faiss/blob/main/c_api/Index_c.h)
+
+**Methods:**
+- `new(obj: ref[ref[RangeSearchResult]], nq: Int[64]): Int`
+- `doAllocation(): Int` - Allocate result buffers
+- `bufferSize(): ArchWord` - Get buffer size
+- `getLims(outLims: ref[ref[array[ArchWord]]])` - Get result limits array
+- `getLabels(outLabels: ref[ref[array[Int[64]]]], outDistances: ref[ref[ref[Float]]])` - Get labels and distances
+
+#### DistanceComputer
+Compute distances to vectors. [C API](https://github.com/facebookresearch/faiss/blob/main/c_api/Index_c.h)
+
+**Methods:**
+- `setQuery(x: ref[array[Float]]): Int` - Set query vector
+- `vectorToQueryDis(i: Int[64], qd: ref[array[Float]]): Int` - Distance to query
+- `symmetricDis(i: Int[64], j: Int[64], vd: ref[array[Float]]): Int` - Symmetric distance
+
+### Constants
+
+#### MetricType
+Distance metrics. [Docs](https://github.com/facebookresearch/faiss/wiki/MetricType-and-distances)
+
+- `METRIC_INNER_PRODUCT: 0` - Inner product (maximum similarity)
+- `METRIC_L2: 1` - Euclidean distance (L2 norm)
+- `METRIC_L1: 2` - Manhattan distance (L1 norm)
+- `METRIC_LINF: 3` - Infinity norm (Chebyshev distance)
+- `METRIC_LP: 4` - Lp norm
+- `METRIC_CANBERRA: 20` - Canberra distance
+- `METRIC_BRAY_CURTIS: 21` - Bray-Curtis dissimilarity
+- `METRIC_JENSEN_SHANNON: 22` - Jensen-Shannon divergence
+
+#### ErrorCode
+Return codes from C API functions.
+
+- `OK: 0` - Success
+- `UNKNOWN_EXCEPT: -1` - Unknown exception
+- `FAISS_EXCEPT: -2` - FAISS exception
+- `STD_EXCEPT: -4` - Standard library exception
+
+### Functions
+
+- `getLastError(): CharsPtr` - Get last error message
+- `kmeansClustering(d: ArchWord, n: ArchWord, k: ArchWord, x: ref[array[Float]], centroids: ref[array[Float]], q_error: ref[Float]) Int` - Standalone k-means
+
+## GPU Support
+
+To enable GPU acceleration, set the environment variable before running:
+```bash
+export FAISS_USE_GPU=1
+```
+
+The library will automatically load GPU-enabled binaries when available. See [FAISS GPU documentation](https://github.com/facebookresearch/faiss/wiki/Faiss-on-the-GPU) for details.
+
+## Index Factory Strings
+
+The `Index.new` factory method accepts strings to create different index types:
+
+- `"Flat"` - Exact search (brute force)
+- `"IVFn,Flat"` - IVF with n centroids, flat encoding
+- `"IVFn,PQm"` - IVF with n centroids, PQ with m subquantizers
+- `"HNSW32"` - Hierarchical navigable small world with 32 neighbors
+- `"IVFn,HNSW32"` - Combined IVF and HNSW
+
+See the [index factory documentation](https://github.com/facebookresearch/faiss/wiki/The-index-factory) for all available options and combinations.
+
+## Examples
+
+Complete working examples are in the `Examples/` directory:
+
+- **example.alusus** - Basic flat index with inner product search
+- **example2.alusus** - IVF index with parameter tuning
+
+## Performance Tips
+
+1. **Index Selection**:
+ - Use `IndexFlat` for exact search on datasets <1M vectors
+ - Use `IndexIVF` for approximate search on larger datasets
+ - See the [index selection guide](https://github.com/facebookresearch/faiss/wiki/Guidelines-to-choose-an-index)
+
+2. **Training**: IVF and other approximate indexes require training before adding vectors
+
+3. **nprobe Parameter**: For IVF indexes, higher nprobe = better accuracy but slower search
+
+4. **GPU Acceleration**: Enable GPU for operations on >10M vectors
+
+5. **Memory**: Flat indexes store all vectors in memory; use compression for large datasets
+
+See [FAISS performance guidelines](https://github.com/facebookresearch/faiss/wiki/Lower-memory-footprint) for detailed recommendations.
+
+## Additional Resources
+
+- **FAISS GitHub**: https://github.com/facebookresearch/faiss
+- **FAISS Wiki**: https://github.com/facebookresearch/faiss/wiki
+- **Research Paper**: [Billion-scale similarity search with GPUs](https://arxiv.org/abs/1702.08734)
+- **Alusus Language**: https://alusus.org
+
+## License
+
+This binding follows the FAISS license (MIT). See the `license` file for details.
diff --git "a/\331\201\331\200\331\212\330\263.\330\243\330\263\330\263" "b/\331\201\331\200\331\212\330\263.\330\243\330\263\330\263"
new file mode 100644
index 0000000..ae77e2c
--- /dev/null
+++ "b/\331\201\331\200\331\212\330\263.\330\243\330\263\330\263"
@@ -0,0 +1,390 @@
+اشمل "Faiss"؛
+
+عرف فـيس: لقب Faiss؛
+@دمج وحدة فـيس {
+ // الثوابت
+
+ عرف رمـز_خطأ: {
+ عرف _نجاح_: لقب ErrorCode.OK؛
+ عرف _استثناء_مجهول_: لقب ErrorCode.UNKNOWN_EXCEPT؛
+ عرف _استثناء_فيس_: لقب ErrorCode.FAISS_EXCEPT؛
+ عرف _استثناء_قياسي_: لقب ErrorCode.STD_EXCEPT؛
+ }
+
+ عرف نـوع_قياس: {
+ عرف _نتاج_داخلي_: لقب MetricType.INNER_PRODUCT؛
+ عرف _ل2_: لقب MetricType.L2؛
+ عرف _ل1_: لقب MetricType.L1؛
+ عرف _ل8_: لقب MetricType.LINF؛
+ عرف _لس_: لقب MetricType.LP؛
+ عرف _كانبيرا_: لقب MetricType.CANBERRA؛
+ عرف _براي_كرتس_: لقب MetricType.BRAY_CURTIS؛
+ عرف _جنسن_شانون_: لقب MetricType.JENSEN_SHANNON؛
+ }
+
+ // الدوال الأساسية
+
+ عرف هات_آخر_خطأ: لقب getLastError؛
+ عرف تجميع_كيمينز: لقب kmeansClustering؛
+
+ // قائمة الصوانات
+
+ عرف قـائمة_صوانات: لقب BufferList؛
+ @دمج صنف قـائمة_صوانات {
+ عرف أنشئ: لقب new؛
+ عرف حرر: لقب free؛
+ عرف ألحق_صوانا: لقب appendBuffer؛
+ عرف أضف: لقب add؛
+ عرف انسخ_مدى: لقب copyRange؛
+ عرف حجم_الصوان: لقب bufferSize؛
+ عرف مؤشر_الكتابة: لقب wp؛
+ }
+
+ // مدى وسيط
+
+ عرف مـدى_وسيط: لقب ParameterRange؛
+ @دمج صنف مـدى_وسيط {
+ عرف الاسم: لقب name؛
+ عرف هات_القيم: لقب getValues؛
+ }
+
+ // فضاء المعامل
+
+ عرف فـضاء_وسيط: لقب ParameterSpace؛
+ @دمج صنف فـضاء_وسيط {
+ عرف أنشئ: لقب new؛
+ عرف حرر: لقب free؛
+ عرف عدد_التوليفات: لقب nCombinations؛
+ عرف هات_اسم_توليفة: لقب getCombinationName؛
+ عرف حدد_وسيط_فهرس: لقب setIndexParameter؛
+ عرف حدد_وسطاء_فهرس: لقب setIndexParameters؛
+ عرف حدد_وسطاء_الفهرس_رقميا: لقب seIndexParametersCno؛
+ عرف اعرض: لقب display؛
+ عرف أضف_مدى: لقب addRange؛
+ }
+
+ // نتيجة استعلام المدى
+
+ عرف نـتيجة_استعلام_مدى: لقب RangeQueryResult؛
+ @دمج صنف نـتيجة_استعلام_مدى {
+ عرف أضف: لقب add؛
+ عرف رقم_الاستعلام: لقب qno؛
+ عرف عدد_النتائج: لقب nres؛
+ عرف النتيجة_الجزئية: لقب pres؛
+ }
+
+ // نتيجة بحث المدى
+
+ عرف نـتيجة_بحث_مدى: لقب RangeSearchResult؛
+ @دمج صنف نـتيجة_بحث_مدى {
+ عرف أنشئ: لقب new؛
+ عرف حرر: لقب free؛
+ عرف نفذ_التخصيص: لقب doAllocation؛
+ عرف عدد_الاستعلامات: لقب nq؛
+ عرف حجم_الصوان: لقب bufferSize؛
+ عرف هات_الحدود: لقب getLims؛
+ عرف هات_الوسوم: لقب getLabels؛
+ }
+
+ عرف نـتيجة_بحث_مدى_جزئية: لقب RangeSearchPartialResult؛
+ @دمج صنف نـتيجة_بحث_مدى_جزئية {
+ عرف أنشئ: لقب new؛
+ عرف حدد_الحدود: لقب setLims؛
+ عرف أنه: لقب finalize؛
+ عرف نتيجة_جديدة: لقب newResult؛
+ عرف النتيجة: لقب res؛
+ }
+
+ // منتقي المعرف
+
+ عرف مـنتقي_معرف: لقب IdSelector؛
+ @دمج صنف مـنتقي_معرف {
+ عرف حرر: لقب free؛
+ عرف أهو_عضو: لقب isMember؛
+ }
+
+ عرف مـنتقي_معرف_حزمة: لقب IdSelectorBatch؛
+ @دمج صنف مـنتقي_معرف_حزمة {
+ عرف منتقي_المعرف: لقب idSelector؛
+ عرف أنشئ: لقب new؛
+ عرف حرر: لقب free؛
+ عرف عدد_البتات: لقب nbits؛
+ عرف القناع: لقب mask؛
+ }
+
+ عرف مـنتقي_معرف_بتماب: لقب IdSelectorBitmap؛
+ @دمج صنف مـنتقي_معرف_بتماب {
+ عرف منتقي_المعرف: لقب idSelector؛
+ عرف أنشئ: لقب new؛
+ عرف حرر: لقب free؛
+ عرف العدد: لقب n؛
+ عرف الخريطة: لقب bitmap؛
+ }
+
+ عرف مـنتقي_معرف_مدى: لقب IdSelectorRange؛
+ @دمج صنف مـنتقي_معرف_مدى {
+ عرف منتقي_المعرف: لقب idSelector؛
+ عرف أنشئ: لقب new؛
+ عرف حرر: لقب free؛
+ عرف الحد_الأدنى: لقب imin؛
+ عرف الحد_الأقصى: لقب imax؛
+ }
+
+ عرف مـنتقي_معرف_نفي: لقب IdSelectorNot؛
+ @دمج صنف مـنتقي_معرف_نفي {
+ عرف منتقي_المعرف: لقب idSelector؛
+ عرف أنشئ: لقب new؛
+ }
+
+ عرف مـنتقي_معرف_و: لقب IdSelectorAnd؛
+ @دمج صنف مـنتقي_معرف_و {
+ عرف منتقي_المعرف: لقب idSelector؛
+ عرف أنشئ: لقب new؛
+ }
+
+ عرف مـنتقي_معرف_أو: لقب IdSelectorOr؛
+ @دمج صنف مـنتقي_معرف_أو {
+ عرف منتقي_المعرف: لقب idSelector؛
+ عرف أنشئ: لقب new؛
+ }
+
+ عرف مـنتقي_معرف_أو_حصري: لقب IdSelectorXor؛
+ @دمج صنف مـنتقي_معرف_أو_حصري {
+ عرف منتقي_المعرف: لقب idSelector؛
+ عرف أنشئ: لقب new؛
+ }
+
+ // حاسب المسافة
+
+ عرف حـاسب_مسافة: لقب DistanceComputer؛
+ @دمج صنف حـاسب_مسافة {
+ عرف حدد_الاستعلام: لقب setQuery؛
+ عرف مسافة_متجه_للاستعلام: لقب vectorToQueryDis؛
+ عرف مسافة_متماثلة: لقب symmetricDis؛
+ عرف حرر: لقب free؛
+ }
+
+ // التجميع
+
+ عرف وسـطاء_تجميع: لقب ClusteringParameters؛
+ @دمج صنف وسـطاء_تجميع {
+ عرف هيئ: لقب init؛
+ }
+
+ عرف إحـصائيات_دورة_تجميع: لقب ClusteringIterationStats؛
+ @دمج صنف إحـصائيات_دورة_تجميع {
+ عرف الهدف: لقب obj؛
+ عرف الوقت: لقب time؛
+ عرف وقت_البحث: لقب timeSearch؛
+ عرف عامل_عدم_التوازن: لقب imbalanceFactor؛
+ عرف عدد_الانقسامات: لقب nSplit؛
+ }
+
+ عرف تـجميع: لقب Clustering؛
+ @دمج صنف تـجميع {
+ عرف أنشئ: لقب new؛
+ عرف حرر: لقب free؛
+ عرف عدد_الدورات: لقب nIter؛
+ عرف عدد_الإعادات: لقب nRedo؛
+ عرف إطناب: لقب verbose؛
+ عرف كروي: لقب spherical؛
+ عرف مراكز_صحيحة: لقب intCentroids؛
+ عرف حدث_الفهرس: لقب updateIndex؛
+ عرف مراكز_مجمدة: لقب frozenCentroids؛
+ عرف أقل_نقاط_لكل_مركز: لقب minPointsPerCentroid؛
+ عرف أكثر_نقاط_لكل_مركز: لقب maxPointsPerCentroid؛
+ عرف البذرة: لقب seed؛
+ عرف حجم_كتلة_فك_الترميز: لقب decodeBlockSize؛
+ عرف البعد: لقب d؛
+ عرف عدد_المراكز: لقب k؛
+ عرف هات_المراكز: لقب getCentroids؛
+ عرف هات_إحصائيات_الدورة: لقب getIterationStats؛
+ عرف درب: لقب train؛
+ }
+
+ // الفهارس
+
+ عرف فـهرس: لقب Index؛
+ @دمج صنف فـهرس {
+ عرف أنشئ: لقب new؛
+ عرف استنسخ: لقب clone؛
+ عرف حرر: لقب free؛
+ عرف البعد: لقب d؛
+ عرف العدد_الكلي: لقب nTotal؛
+ عرف مدرب: لقب isTrained؛
+ عرف نوع_القياس: لقب metricType؛
+ عرف إطناب: لقب verbose؛
+ عرف درب: لقب train؛
+ عرف أضف: لقب add؛
+ عرف ابحث: لقب search؛
+ عرف بحث_المدى: لقب rangeSearch؛
+ عرف عين: لقب assign؛
+ عرف أعد_الضبط: لقب reset؛
+ عرف احذف_المعرفات: لقب removeIds؛
+ عرف أعد_البناء: لقب reconstruct؛
+ عرف احسب_المتبقي: لقب computeResidual؛
+ عرف هات_حجم_الشفرة: لقب getSaCodeSize؛
+ عرف رمز: لقب saEncode؛
+ عرف فك_الترميز: لقب saDecode؛
+ }
+
+ عرف فـهرس_ثنائي: لقب IndexBinary؛
+ @دمج صنف فـهرس_ثنائي {
+ عرف الفهرس: لقب index؛
+ عرف أنشئ: لقب new؛
+ عرف استنسخ: لقب clone؛
+ عرف حرر: لقب free؛
+ عرف البعد: لقب d؛
+ عرف مدرب: لقب isTrained؛
+ عرف العدد_الكلي: لقب nTotal؛
+ عرف نوع_القياس: لقب metricType؛
+ عرف إطناب: لقب verbose؛
+ عرف درب: لقب train؛
+ عرف أضف: لقب add؛
+ عرف ابحث: لقب search؛
+ عرف عين: لقب assign؛
+ عرف أعد_الضبط: لقب reset؛
+ عرف احذف_المعرفات: لقب removeIds؛
+ عرف أعد_البناء: لقب reconstruct؛
+ }
+
+ عرف فـهرس_ثنائي_ملف_معكوس: لقب IndexBinaryIvf؛
+ @دمج صنف فـهرس_ثنائي_ملف_معكوس {
+ عرف الفهرس_الثنائي: لقب indexBinary؛
+ عرف حرر: لقب free؛
+ عرف مثل: لقب cast؛
+ عرف عدد_القوائم: لقب nList؛
+ عرف عدد_الاستقصاءات: لقب nProbe؛
+ عرف المكمم: لقب quantizer؛
+ عرف يمتلك_الحقول: لقب ownFields؛
+ عرف أقصى_شفرات: لقب maxCodes؛
+ عرف استخدم_الكومة: لقب useHeap؛
+ عرف بحث_لكل_قائمة_معكوسة: لقب perInvlistSearch؛
+ عرف ادمج_من: لقب mergeFrom؛
+ عرف ابحث_في_المحدد_مسبقا: لقب searchPreassigned؛
+ عرف هات_حجم_القائمة: لقب getListSize؛
+ عرف اصنع_تعيينا_مباشرا: لقب makeDirectMap؛
+ عرف عامل_عدم_التوازن: لقب imbalanceFactor؛
+ عرف اطبع_الإحصائيات: لقب printStats؛
+ }
+
+ عرف فـهرس_مسطح: لقب IndexFlat؛
+ @دمج صنف فـهرس_مسطح {
+ عرف الفهرس: لقب index؛
+ عرف أنشئ: لقب new؛
+ عرف مثل: لقب cast؛
+ عرف حرر: لقب free؛
+ عرف هات_البيانات: لقب getXb؛
+ عرف احسب_مسافة_مجموعة_جزئية: لقب computeDistanceSubset؛
+ }
+
+ عرف فـهرس_مسطح_آيبي: لقب IndexFlatIp؛
+ @دمج صنف فـهرس_مسطح_آيبي {
+ عرف الفهرس: لقب index؛
+ عرف أنشئ: لقب new؛
+ عرف مثل: لقب cast؛
+ عرف حرر: لقب free؛
+ }
+
+ عرف فـهرس_مسطح_ل2: لقب IndexFlatL2؛
+ @دمج صنف فـهرس_مسطح_ل2 {
+ عرف الفهرس: لقب index؛
+ عرف أنشئ: لقب new؛
+ عرف مثل: لقب cast؛
+ عرف حرر: لقب free؛
+ }
+
+ عرف فـهرس_تنقية_مسطح: لقب IndexRefineFlat؛
+ @دمج صنف فـهرس_تنقية_مسطح {
+ عرف الفهرس: لقب index؛
+ عرف أنشئ: لقب new؛
+ عرف مثل: لقب cast؛
+ عرف حرر: لقب free؛
+ عرف يمتلك_الحقول: لقب ownFields؛
+ عرف عامل_ك: لقب kFactor؛
+ }
+
+ عرف فـهرس_مسطح_أحادي_البعد: لقب IndexFlat1D؛
+ @دمج صنف فـهرس_مسطح_أحادي_البعد {
+ عرف الفهرس: لقب index؛
+ عرف أنشئ: لقب new؛
+ عرف مثل: لقب cast؛
+ عرف حرر: لقب free؛
+ عرف حدث_التبديل: لقب updatePermutation؛
+ }
+
+ عرف فـهرس_ملف_معكوس: لقب IndexIvf؛
+ @دمج صنف فـهرس_ملف_معكوس {
+ عرف الفهرس: لقب index؛
+ عرف حرر: لقب free؛
+ عرف مثل: لقب cast؛
+ عرف عدد_القوائم: لقب nList؛
+ عرف عدد_الاستقصاءات: لقب nProbe؛
+ عرف المكمم: لقب quantizer؛
+ عرف المكمم_يتدرب_وحيدا: لقب quantizerTrainsAlone؛
+ عرف يمتلك_الحقول: لقب ownFields؛
+ عرف ادمج_من: لقب mergeFrom؛
+ عرف انسخ_مجموعة_جزئية_إلى: لقب copySubsetTo؛
+ عرف ابحث_في_المحدد_مسبقا: لقب searchPreassigned؛
+ عرف هات_حجم_القائمة: لقب getListSize؛
+ عرف اصنع_تعيينا_مباشرا: لقب makeDirectMap؛
+ عرف عامل_عدم_التوازن: لقب imbalanceFactor؛
+ عرف اطبع_الإحصائيات: لقب printStats؛
+ عرف أحضر_معرفات_القائمة_المعكوسة: لقب getInvlistIds؛
+ عرف درب_المرمز: لقب trainEncoder؛
+ }
+
+ عرف فـهرس_تعيين_معرفات: لقب IndexIdMap؛
+ @دمج صنف فـهرس_تعيين_معرفات {
+ عرف الفهرس: لقب index؛
+ عرف أنشئ: لقب new؛
+ عرف مثل: لقب cast؛
+ عرف يمتلك_الحقول: لقب ownFields؛
+ عرف هات_تعيين_المعرفات: لقب getIdMap؛
+ عرف الفهرس_الفرعي: لقب subIndex؛
+ }
+
+ عرف فـهرس_تعيين_معرفات2: لقب IndexIdMap2؛
+ @دمج صنف فـهرس_تعيين_معرفات2 {
+ عرف الفهرس: لقب index؛
+ عرف أنشئ: لقب new؛
+ عرف مثل: لقب cast؛
+ عرف يمتلك_الحقول: لقب ownFields؛
+ عرف اصنع_تعيينا_عكسيا: لقب constructRevMap؛
+ عرف هات_تعيين_المعرفات: لقب getIdMap؛
+ عرف الفهرس_الفرعي: لقب subIndex؛
+ }
+
+ // إحصائيات فهرس IVF
+
+ عرف إـحصائيات_فهرس_ملف_معكوس: لقب IndexIvfStats؛
+ @دمج صنف إـحصائيات_فهرس_ملف_معكوس {
+ عرف عدد_الاستعلامات: لقب nq؛
+ عرف عدد_القوائم: لقب nList؛
+ عرف عدد_المسافات: لقب nDis؛
+ عرف عدد_تحديثات_الكومة: لقب nHeapUpdates؛
+ عرف وقت_التكميم: لقب quantizationTime؛
+ عرف وقت_البحث: لقب searchTime؛
+ عرف أعد_الضبط: لقب reset؛
+ }
+
+ // وسطاء البحث
+
+ عرف وسـطاء_بحث: لقب SearchParameters؛
+ @دمج صنف وسـطاء_بحث {
+ عرف أنشئ: لقب new؛
+ عرف حرر: لقب free؛
+ عرف عدد_الاستقصاءات: لقب nProbe؛
+ }
+
+ عرف وسـطاء_بحث_ملف_معكوس: لقب SearchParametersIvf؛
+ @دمج صنف وسـطاء_بحث_ملف_معكوس {
+ عرف وسطاء_البحث: لقب searchParameters؛
+ عرف أنشئ: لقب new؛
+ عرف حرر: لقب free؛
+ عرف مثل: لقب cast؛
+ عرف المنتقي: لقب sel؛
+ عرف عدد_الاستقصاءات: لقب nProbe؛
+ عرف أقصى_شفرات: لقب maxCodes؛
+ }
+}