mycai 1.0.2 → 1.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/core/morphology.js +4 -1
- package/package.json +1 -1
- package/sdk/ingestion.js +14 -9
package/core/morphology.js
CHANGED
|
@@ -155,7 +155,10 @@ export class TurkishMorphology {
|
|
|
155
155
|
// Fiiller (ek kökler)
|
|
156
156
|
'oku', 'yaz', 'bak', 'çalış', 'ye', 'iç', 'uyu', 'kalk', 'otur', 'koş',
|
|
157
157
|
'sor', 'söyle', 'dinle', 'bekle', 'başla', 'bitir', 'aç', 'kapat', 'getir', 'götür',
|
|
158
|
-
'koy', 'çıkar', 'kaydet', 'güncelle', 'kontrol'
|
|
158
|
+
'koy', 'çıkar', 'kaydet', 'güncelle', 'kontrol', 'durdur',
|
|
159
|
+
// Endüstriyel, otomasyon ve mühendislik terimleri
|
|
160
|
+
'pompa', 'vana', 'motor', 'şalter', 'kazan', 'basınç', 'arıza', 'valf', 'hız', 'boru',
|
|
161
|
+
'tank', 'fan', 'akım', 'gerilim', 'sıcaklık', 'soğut', 'hararet', 'şebeke', 'sensör', 'şalter'
|
|
159
162
|
];
|
|
160
163
|
}
|
|
161
164
|
|
package/package.json
CHANGED
package/sdk/ingestion.js
CHANGED
|
@@ -25,25 +25,30 @@ export class IngestionEngine {
|
|
|
25
25
|
* @returns {Promise<{ success: boolean, records: Array<{ query: string, content: string, confidence: number }>, stats: Object }>}
|
|
26
26
|
*/
|
|
27
27
|
async ingest(input) {
|
|
28
|
-
if (!input
|
|
29
|
-
throw new Error('Ingest input requires a valid
|
|
28
|
+
if (!input) {
|
|
29
|
+
throw new Error('Ingest input requires a valid document or string');
|
|
30
30
|
}
|
|
31
31
|
|
|
32
|
-
const
|
|
33
|
-
|
|
34
|
-
|
|
32
|
+
const payloadData = typeof input === 'string' ? input : (input.data || input.content || input.text);
|
|
33
|
+
if (!payloadData) {
|
|
34
|
+
throw new Error('Ingest input requires a valid "data", "content", or "text" field');
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
const type = (typeof input === 'object' && input.type ? input.type : this._detectType({ data: payloadData })).toLowerCase();
|
|
38
|
+
const title = (typeof input === 'object' && input.title) ? input.title : 'Belge';
|
|
39
|
+
const metadata = (typeof input === 'object' && input.metadata) ? input.metadata : {};
|
|
35
40
|
|
|
36
41
|
switch (type) {
|
|
37
42
|
case 'pdf':
|
|
38
|
-
return await this.ingestPdf(
|
|
43
|
+
return await this.ingestPdf(payloadData, title, metadata);
|
|
39
44
|
case 'csv':
|
|
40
45
|
case 'tsv':
|
|
41
|
-
return this.ingestCsv(
|
|
46
|
+
return this.ingestCsv(payloadData, title, metadata);
|
|
42
47
|
case 'url':
|
|
43
|
-
return await this.ingestUrl(
|
|
48
|
+
return await this.ingestUrl(payloadData, title, metadata);
|
|
44
49
|
case 'text':
|
|
45
50
|
default:
|
|
46
|
-
return this.ingestText(
|
|
51
|
+
return this.ingestText(payloadData, title, metadata);
|
|
47
52
|
}
|
|
48
53
|
}
|
|
49
54
|
|