Wednesday 4 September 2013

Türkçe Kelime Ayrıştırıcısı (Turkish Word Parser) Beta 0.00


Türkçe Kelime Ayrıştırıcısı (Turkish Word Parser) Beta 0.00

Verilen bir metni anlayıp buna ilişkin soruları cevaplayan programımın ilk aşaması kabaca bitti.

Bundan sonra dokümantasyon ve çok ince yan etkileri temizlemekten oluşuyor.  Çıktılar bundan sonraki aşamalara girdi olabilecek formattadır.

Dikkat edilirse aynı harflerden oluşan fakat anlamı farklı kelimeler vardır.  Programım bu kelime alternatiflerini

Aynı kelime yapısı içinde listelemektedir.  Bundan sonraki aşamada basit birparser yazarak mümkün bütün kelime alternatiflerinden mümkün bütün cümle alternatiflerini oluşturacağım.

 Daha sonraki aşamada ise müşterinin sorusuna ilişkin cevabı içeren cümleyi bir parser arasılığı ile otomatik olarak seçeceğim.  Bunu yapabilmek için müşterinin sorusunuda parçalarına ayıracak bir soru parserı yazmak gerekecek.  Ayrıca parse edilmiş bu soruyu cevap makinasının içine dinamik olarak gömmek gerekir.

 Ali Rıza SARAL


 İlk olarak bir kaç kelime örneği:

 elmalar
tanıdık
tanıdıklara
yaptırtabilememiştim

 test00.txt

 WORD(

 Root("İsim"(elma,"16107","0"))
rootWithExt(nounExt(#lar %%  % ))

 Root(not-identified(elma,"16107","0"))
rootWithExt(nounExt(#lar %%  % ))
)=elmalar

 WORD(

 Root("İsim"(tanı,"49556","0"))
rootWithExt(verbFromNounExt(<dı<k))

 Root(Fiil(tanı,"49568","0"))
rootWithExt(verbExt( :: -dı : *k))

rootWithExt(adjectiveFromVerbExt(.dık))
rootWithExt(nounFromVerbExt(<dık))
)=tanıdık

 WORD(

 Root(Fiil(tanı,"49568","0"))
rootWithExt(nounFromVerbExt(<dık<lar - a))
)=tanıdıklara

 WORD(

 Root(Fiil(yap,"55685","0"))
rootWithExt(verbExt(+tır+t+abil :: -ememiş-ti : *m))

 Root(Fiil(yaptır,"55718","0"))
rootWithExt(verbExt(+t+abil :: -ememiş-ti : *m))

 Root(Fiil(yaptırt,"55720","0"))
rootWithExt(verbExt(+abil :: -ememiş-ti : *m))
)=yaptırtabilememiştim

 İkinci olarak bunları gerçekten bir programla yaptığımı göstermesi açısından Hemingway’in ünlü romanından küçük bir pasaj:

 farelere
ve
insanlara dair

 Salinas Irmağı, Soledad kasabasının birkaç mil güneyinde, dağlık taraftaki kıyıya yakın, yüksekçe bir yerden dökülür ve buradan itibaren derinleşir ve suları yeşil bir renk alır. Suyu da ılıktır, çünkü bu dar gölcüğe gelinceye kadar, sıcak güneşin altında, sapsarı kumların
üstünden parıldaya, parıldaya kayıp akar.

 farelerInsanlar0000.txt

 WORD(

 Root("İsim"(fare,"17561","0"))
rootWithExt(nounExt(#ler %%  % &e))

 Root(not-identified(fare,"17561","0"))
rootWithExt(nounExt(#ler %%  % &e))
)=farelere

 WORD(

 Root("Bağlaç"(ve,"54481","0"))
)=ve

 WORD(

 Root("İsim"(insan,"25138","0"))
rootWithExt(nounExt(#lar %%  % &a))

 Root(not-identified(insan,"25138","0"))
rootWithExt(nounExt(#lar %%  % &a))
)=insanlara

 WORD(

 Root("Sıfat"(dair,"11873","0"))
)=dair

 WORD(
)=Salinas

 WORD(

 Root(Fiil(I,"24817","0"))
rootWithExt(nounFromVerbExt(<r<mağ - ı))

 Root(not-identified(Irmağ,"23645","0"))
rootWithExt(nounExt( %% ?ı % ))
)=Irmağı

 WORD(
)=Soledad

 WORD(

 Root("İsim"(kasaba,"28224","0"))
rootWithExt(nounExt( %% =sı % &nın))
)=kasabasının

 WORD(

 Root("Sıfat"(birkaç,"6986","0"))
)=birkaç

 WORD(

 Root("İsim"(mil,"36085","0"))

Root(not-identified(mil,"36086","0"))
)=mil

 WORD(

 Root("İsim"(güney,"21026","0"))
rootWithExt(nounExt( %% ?in % &de))
)=güneyinde

 WORD(

 Root("İsim"(dağ,"11748","0"))
rootWithExt(nounExt(#lık %%  % ))

 Root("Sıfat"(dağlık,"11827","0"))
)=dağlık

 WORD(

Root("İsim"(taraf,"49718","0"))
rootWithExt(nounExt( %%  % &ta&ki))

 Root(not-identified(taraf,"49718","0"))
rootWithExt(nounExt( %%  % &ta&ki))
)=taraftaki

 WORD(

Root(Fiil(kıy,"30272","0"))
rootWithExt(gerundFromVerbExt( ;; ;.ı.y.a))

 Root("İsim"(kıyı,"30246","0"))
rootWithExt(nounExt( %%  % &y&a))

rootWithExt(verbFromNounExt(<ya))

 Root(not-identified(kıyı,"30246","0"))

rootWithExt(nounExt( %%  % &y&a))
rootWithExt(verbFromNounExt(<ya))
)=kıyıya

 WORD(

 Root("İsim"(yak,"55147","0"))
rootWithExt(nounExt( %% ?ın % ))

 Root(Fiil(yak,"55244","0"))
rootWithExt(verbExt(+ın ::  : ))

 Root("İsim"(yakı,"55172","0"))
rootWithExt(nounExt( %% =n % ))

 Root("İsim"(yakın,"55180","0"))
Root(not-identified(yakın,"55180","0")) 

Root("Sıfat"(yakın,"55180","0"))

 Root("Zarf"(yakın,"55180","0"))

 Root(Fiil(yakın,"55202","0"))
)=yakın

 

WORD(

 

Root("İsim"(yüksek,"57690","0"))

rootWithExt(nounExt( %%  % &çe))

 

Root(not-identified(yüksek,"57690","0"))

rootWithExt(nounExt( %%  % &çe))

)=yüksekçe

 

WORD(

 

Root("İsim"(bir,"6880","0"))

 

Root(not-identified(bir,"6880","0"))

 

Root("Sıfat"(bir,"6880","0"))

 

Root("Zarf"(bir,"6880","0"))

)=bir

 

WORD(

 

Root("İsim"(yer,"56679","0"))

rootWithExt(nounExt( %%  % &den))

 

Root(not-identified(yer,"56679","0"))

rootWithExt(nounExt( %%  % &den))

)=yerden

 

WORD(

 

Root(Fiil(dök,"14537","0"))

rootWithExt(verbExt(+ül :: -ür : ))

 

Root(Fiil(dökül,"14544","0"))

rootWithExt(verbExt( :: -ür : ))

)=dökülür

 

WORD(

 

Root("Bağlaç"(ve,"54481","0"))

)=ve

 

WORD(

 

Root("İsim"(bura,"8113","0"))

rootWithExt(nounExt( %%  % &dan))

 

Root(not-identified(bura,"8113","0"))

rootWithExt(nounExt( %%  % &dan))

 

Root("Zarf"(buradan,"8116","0"))

)=buradan

 

WORD(

 

Root("Zarf"(itibaren,"25937","0"))

)=itibaren

 

WORD(

 

Root(Fiil(derinleş,"12989","0"))

rootWithExt(verbExt( :: -ir : ))

rootWithExt(adjectiveFromVerbExt(.ir))

rootWithExt(nounFromVerbExt(<ir))

)=derinleşir

 

WORD(

 

Root("Bağlaç"(ve,"54481","0"))

)=ve

 

WORD(

 

Root("İsim"(su,"47231","0"))

rootWithExt(nounExt(#lar %% ?ı % ))

 

Root(not-identified(su,"47231","0"))

rootWithExt(nounExt(#lar %% ?ı % ))

 

Root(Fiil(sula,"47343","0"))

rootWithExt(gerundFromVerbExt( ;;r ;.ı))

)=suları

 

WORD(

 

Root("İsim"(yeşil,"56813","0"))

 

Root("Sıfat"(yeşil,"56813","0"))

)=yeşil

 

WORD(

 

Root("İsim"(bir,"6880","0"))

 

Root(not-identified(bir,"6880","0"))

 

Root("Sıfat"(bir,"6880","0"))

 

Root("Zarf"(bir,"6880","0"))

)=bir

 

WORD(

 

Root("İsim"(renk,"42883","0"))

 

Root(not-identified(renk,"42883","0"))

)=renk

 

WORD(

 

Root(Fiil(al,"1898","0"))

rootWithExt(verbExt( :: -ır : ))

rootWithExt(adjectiveFromVerbExt(.ır))

rootWithExt(nounFromVerbExt(<ır))

)=alır

 

WORD(

 

Root("İsim"(Su,"47231","0"))

rootWithExt(nounExt( %%  % &y&u))

 

Root(not-identified(Su,"47231","0"))

rootWithExt(nounExt( %%  % &y&u))

)=Suyu

 

WORD(

)=da

 

WORD(

)=ılıktır

 

WORD(

 

Root("Bağlaç"(çünkü,"11711","0"))

)=çünkü

 

WORD(

 

Root("Sıfat"(bu,"7856","0"))

 

Root("Zamir"(bu,"7856","0"))

)=bu

 

WORD(

 

Root("İsim"(dar,"12167","0"))

 

Root(not-identified(dar,"12166","0"))

 

Root("Sıfat"(dar,"12166","0"))

 

Root("Zarf"(dar,"12166","0"))

)=dar

 

WORD(

 

Root("İsim"(göl,"20154","0"))

rootWithExt(nounExt(#cüğ %%  % &e))

 

Root(not-identified(göl,"20154","0"))

rootWithExt(nounExt(#cüğ %%  % &e))

 

Root(not-identified(gölcüğ,"20158","0"))

rootWithExt(nounExt( %%  % &e))

)=gölcüğe

 

WORD(

 

Root(Fiil(gel,"19369","0"))

rootWithExt(gerundFromVerbExt(in ;; ;.ceye))

 

Root("İsim"(gelin,"19328","0"))

rootWithExt(nounExt( %%  % &ce&y&e))

rootWithExt(verbFromNounExt(ce - <ye))

 

Root(not-identified(gelin,"19328","0"))

rootWithExt(nounExt( %%  % &ce&y&e))

rootWithExt(verbFromNounExt(ce - <ye))

 

Root(Fiil(gelin,"19346","0"))

rootWithExt(gerundFromVerbExt( ;; ;.ceye))

)=gelinceye

 

WORD(

 

Root("İsim"(kadar,"26475","0"))

 

Root(not-identified(kadar,"26475","0"))

 

Root("Edat"(kadar,"26475","0"))

)=kadar

 

WORD(

 

Root(Fiil(sıc,"45474","0"))

rootWithExt(gerundFromVerbExt( ;; ;.ak))

 

Root("İsim"(sıcak,"45444","0"))

 

Root(not-identified(sıcak,"45444","0"))

)=sıcak

 

WORD(

 

Root("İsim"(güneş,"20996","0"))

rootWithExt(nounExt( %% ?in % ))

 

Root(not-identified(güneş,"20996","0"))

rootWithExt(nounExt( %% ?in % ))

)=güneşin

 

WORD(

 

Root("İsim"(altı,"1949","0"))

rootWithExt(nounExt( %% =n % &da))

 

Root("İsim"(altın,"1955","0"))

rootWithExt(nounExt( %%  % &da))

 

Root(not-identified(altın,"1955","0"))

rootWithExt(nounExt( %%  % &da))

)=altında

 

WORD(

 

Root("Sıfat"(sapsarı,"44172","0"))

)=sapsarı

 

WORD(

 

Root("İsim"(kum,"32338","0"))

rootWithExt(nounExt(#lar %%  % ?ın))

 

Root(not-identified(kum,"32338","0"))

rootWithExt(nounExt(#lar %%  % ?ın))

)=kumların

 

WORD(

 

Root(not-identified(üst,"53992","0"))

rootWithExt(nounExt( %% =ün % &den))

 

Root("İsim"(üstün,"54039","0"))

rootWithExt(nounExt( %%  % &den))

 

Root(not-identified(üstün,"54038","0"))

rootWithExt(nounExt( %%  % &den))

)=üstünden

 

WORD(

 

Root(Fiil(parılda,"40848","0"))

rootWithExt(gerundFromVerbExt( ;; ;.y.a))

)=parıldaya

 

WORD(

 

Root(Fiil(parılda,"40848","0"))

rootWithExt(gerundFromVerbExt( ;; ;.y.a))

)=parıldaya

 

WORD(

 

Root(Fiil(kay,"28826","0"))

rootWithExt(gerundFromVerbExt( ;; ;.ıp))

 

Root("İsim"(kayıp,"28783","0"))

 

Root("Sıfat"(kayıp,"28783","0"))

)=kayıp

 

WORD(

 

Root(Fiil(ak,"1311","0"))

rootWithExt(verbExt( :: -ar : ))

rootWithExt(adjectiveFromVerbExt(.ar))

rootWithExt(nounFromVerbExt(<ar))

 

Root("İsim"(akar,"1132","0"))

)=akar

,=         7 ---> %1.977 + +>

.=         2 ---> %0.565 +>

I=         1 ---> %0.282 +>

S=         3 ---> %0.847 +>

a=        43 ---> %12.147 + + + + + + + + + + + + +>

b=         7 ---> %1.977 + +>

c=         3 ---> %0.847 +>

d=        16 ---> %4.520 + + + + +>

e=        24 ---> %6.780 + + + + + + +>

f=         2 ---> %0.565 +>

g=         4 ---> %1.130 + +>

i=        16 ---> %4.520 + + + + +>

k=        17 ---> %4.802 + + + + +>

l=        18 ---> %5.085 + + + + + +>

m=         3 ---> %0.847 +>

n=        21 ---> %5.932 + + + + + +>

o=         1 ---> %0.282 +>

p=         4 ---> %1.130 + +>

r=        26 ---> %7.345 + + + + + + + +>

s=        10 ---> %2.825 + + +>

t=         6 ---> %1.695 + +>

u=         6 ---> %1.695 + +>

v=         3 ---> %0.847 +>

y=        12 ---> %3.390 + + + +>

ç=         3 ---> %0.847 +>

ğ=         3 ---> %0.847 +>

ö=         2 ---> %0.565 +>

ü=        10 ---> %2.825 + + +>

ı=        19 ---> %5.367 + + + + + +>

ş=         3 ---> %0.847 +>

  ----------

TOT#=    354

 

 

TOT WORDS#=     48

*************** WORDS referred > 0  times

             al=         1 ---> %2.083 + + + + + + + + + + + + + + + + + + + + +>

          altın=         1 ---> %2.083 + + + + + + + + + + + + + + + + + + + + +>

           akar=         1 ---> %2.083 + + + + + + + + + + + + + + + + + + + + +>

         birkaç=         1 ---> %2.083 + + + + + + + + + + + + + + + + + + + + +>

        buradan=         1 ---> %2.083 + + + + + + + + + + + + + + + + + + + + +>

             bu=         1 ---> %2.083 + + + + + + + + + + + + + + + + + + + + +>

           dair=         1 ---> %2.083 + + + + + + + + + + + + + + + + + + + + +>

         dağlık=         1 ---> %2.083 + + + + + + + + + + + + + + + + + + + + +>

          dökül=         1 ---> %2.083 + + + + + + + + + + + + + + + + + + + + +>

       derinleş=         1 ---> %2.083 + + + + + + + + + + + + + + + + + + + + +>

              d=         1 ---> %2.083 + + + + + + + + + + + + + + + + + + + + +>

            dar=         1 ---> %2.083 + + + + + + + + + + + + + + + + + + + + +>

           fare=         1 ---> %2.083 + + + + + + + + + + + + + + + + + + + + +>

          güney=         1 ---> %2.083 + + + + + + + + + + + + + + + + + + + + +>

         gölcüğ=         1 ---> %2.083 + + + + + + + + + + + + + + + + + + + + +>

          gelin=         1 ---> %2.083 + + + + + + + + + + + + + + + + + + + + +>

          güneş=         1 ---> %2.083 + + + + + + + + + + + + + + + + + + + + +>

          insan=         1 ---> %2.083 + + + + + + + + + + + + + + + + + + + + +>

          Irmağ=         1 ---> %2.083 + + + + + + + + + + + + + + + + + + + + +>

       itibaren=         1 ---> %2.083 + + + + + + + + + + + + + + + + + + + + +>

         kasaba=         1 ---> %2.083 + + + + + + + + + + + + + + + + + + + + +>

           kıyı=         1 ---> %2.083 + + + + + + + + + + + + + + + + + + + + +>

          kadar=         1 ---> %2.083 + + + + + + + + + + + + + + + + + + + + +>

          kumla=         1 ---> %2.083 + + + + + + + + + + + + + + + + + + + + +>

          kayıp=         1 ---> %2.083 + + + + + + + + + + + + + + + + + + + + +>

            mil=         1 ---> %2.083 + + + + + + + + + + + + + + + + + + + + +>

           renk=         1 ---> %2.083 + + + + + + + + + + + + + + + + + + + + +>

          Salin=         1 ---> %2.083 + + + + + + + + + + + + + + + + + + + + +>

            Sol=         1 ---> %2.083 + + + + + + + + + + + + + + + + + + + + +>

           sula=         1 ---> %2.083 + + + + + + + + + + + + + + + + + + + + +>

             Su=         1 ---> %2.083 + + + + + + + + + + + + + + + + + + + + +>

          sıcak=         1 ---> %2.083 + + + + + + + + + + + + + + + + + + + + +>

        sapsarı=         1 ---> %2.083 + + + + + + + + + + + + + + + + + + + + +>

          taraf=         1 ---> %2.083 + + + + + + + + + + + + + + + + + + + + +>

          yakın=         1 ---> %2.083 + + + + + + + + + + + + + + + + + + + + +>

         yüksek=         1 ---> %2.083 + + + + + + + + + + + + + + + + + + + + +>

            yer=         1 ---> %2.083 + + + + + + + + + + + + + + + + + + + + +>

          yeşil=         1 ---> %2.083 + + + + + + + + + + + + + + + + + + + + +>

          çünkü=         1 ---> %2.083 + + + + + + + + + + + + + + + + + + + + +>

        üstünde=         1 ---> %2.083 + + + + + + + + + + + + + + + + + + + + +>

           ılık=         1 ---> %2.083 + + + + + + + + + + + + + + + + + + + + +>

            bir=         2 ---> %4.167 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +>

        parılda=         2 ---> %4.167 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +>

             ve=         3 ---> %6.250 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +>

  ----------

TOT#=     48