Home
Name Modified Size Downloads / Week Status
Totals: 5 Items   21.4 kB 5
readme.txt 2010-04-20 4.1 kB 11 weekly downloads
search.cpp 2010-04-20 14.9 kB 11 weekly downloads
input.txt 2010-04-02 42 Bytes 11 weekly downloads
pattern.txt 2010-04-02 1.6 kB 11 weekly downloads
types.dat 2010-04-02 893 Bytes 11 weekly downloads
Download all files to a directory and do the following compilation. g++ search.cpp -o rib ./rib input.txt This program is purely ansi and has been tested in VS6.0. Compile/Run as per your IDE option. RIB --- This project presents a way to recognize text by matching it with a sequence of patterns of the form word-relation. On a successful match the program executes a simple macro language that is capable of text output or call scripts/executables. This macro-language calls can be passed values that were matched in the pattern. Text : A B C Pattern : w1.r1 w2.r2 w3.r3 Action : PRINT @1 Action : SYSTEM awk '{getline x < @2 ; print x;}' END The relation is one of class-member, has-property, works-like-a, sounds-like-a, rhymes-like-a, contains-a or is-part-of-a or synonym-antonym. The program hardcodes the file "pattern.txt" which contains the pattern2macro mapping and the ontological structure that is part of the file "types.dat". The program being in public domain the interested user can modify it to likings. An input file with lines terminated with a "." is the only argument to the program. The pattern.txt contains a sequence of word-relation combinations that can be matched in any order with the input. A set of macros like PRINT, SYSTEM are used to perform the actions. A relation on correctly matching sets the "@"n variable. These values can be used by the scripts that the macros call. Not to deny I have taken a leaf out of yacc which maps grammar rules to programming action. Ontology for the relations is described better in a language like perl. It depends on how wide an application net the idea can cast that future versions can be refined. A sample ontology "types.dat" file is presented here, thing m living_thing non_living_thing living-thing m animal bird acquatic-animal micororganism plant non-living-thing m office-things educational-things health-things religious-things communication-things devices fashion transport-things fuel food food m fruit vegetable cereals junk-food soda fruit m apple orange apple p pink thing p color shape logo height weight length age size cost comfort complexity color m violet blue red indigo green yellow orange office-things m computer fax phone stationary computer co cd-drive memory computer re logic computer i Software-Programmer Software-Programmer ph late night snacks.m c-keyword m for while if else case switch do economic-disasters re natural-disasters economic-disasters re corruption natural-disasters m flood earthquake volcano bomb explosion re bomb explosion so boom doom datatype m int float char finance re money integer pt ^[0-9]+$ conv m itoa atoi change so convert change getting so input get give cinput m fgets scanf m5 pt ^5+$ decrement m -- increment m ++ article pt ^(a)|(A)|(the)$ condLoop pt [a-z0-9<>=;]+ lparen m ( rparen m ) lcurly m { rcurly m } ckey m for while sounds-like-female-clothing so sari salwar women re fashion france indian re poverty culture festivals indian-clothing so sari dhoti explosion re war terror major-disaster re armegeddon fact-prog so fact factorial jungle-animal m lion gorilla tiger giraffe genius so einstein newton galelio davinci vijayshankar bitwise pt ^<<=$ ^<<$ ^>>$ ^>>=$ ^\|=$ ^&~$ laugh pt ^(ha)+|(ah)+$ near pt ^[^n]*near.*$ far pt ^[^f]*far.*$ distance m near far destruction m destroyed crashed ruin wreckage aeroplane c device aeroplane w flying-thing bird w flying-thing single-lower-case-letter pt ^[a-z]$ single-upper-case-letter pt ^[A-Z]$ request so please request give seek obtain extract fish comparison-g so greater more higher longer no so dont never no nay don't START so starts commences originates color m white black blue orange green brown red violet indigo purple cyan yellow magenta technology re computer instruments environment software communication software m spreadsheet wordprocessor compilers ide os database protocols cheated w misconception red-herring finance-companies mutual-funds dudey so hey dude cmon yar man whassup holdup so kill holdup Kill m Kill_1 Kill_1 ph Police.re visit
Source: readme.txt, updated 2010-04-20

Thanks for helping keep SourceForge clean.

Screenshot instructions:
Windows
Mac
Red Hat Linux   Ubuntu

Click URL instructions:
Right-click on ad, choose "Copy Link", then paste here →
(This may not be possible with some types of ads)

More information about our ad policies
X

Briefly describe the problem (required):

Upload screenshot of ad (required):
Select a file, or drag & drop file here.

Please provide the ad click URL, if possible:

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

No, thanks