LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   JAVA --> programming automata (https://www.linuxquestions.org/questions/programming-9/java-programming-automata-639632/)

mayaabboud 05-03-2008 01:03 PM

JAVA --> programming automata
 
hellow everyone,

i am working on a project for the university, i have to write a program in java that searches a text for a word using one or several automata !

i dont know in which dirction to look for further helpful information. I have had java courses, but we never learned how to describe an automaton using java.

any suggestions would be a big help. i ve been working for a couple of days on this. and i must admit that im kinda stuck :(

thx alot in advance for any comments or suggestions from all u out there

maya

PTrenholme 05-03-2008 01:53 PM

If those "automata" are separate programs, try executing them with the appropriate call from your JAVA script, capture the output, and process it. If they have a "callable" interface, write code to invoke the application using its interface.

On the other hand, if the "automata" are algorithms that you are supposed to code in JAVA as a class project, well, you'll learn more by doing that task. (Since it's a "university" for which you are doing the project, I was wondering if the "project" as a class assignment.)

Bottom line: Your question seem to lack sufficient detail, and can only be answered in very general terms. You tell neither what the "automata" are, nor how they are to be used, nor what your system design looks like, nor what you've already tried.

mayaabboud 05-03-2008 02:22 PM

JAVA -> finite automata
 
hi,

thx for replying,

finite automata are a composition of states and transitions.

so i have to look for the 'passive-agent'in a text, like : john was hit by paul --> paul would be what i was looking for

so, i have written rules in the form of automata:

start ->(1) -P-> (2)-NP->((3))

1,2 and 3 representing states and P being my preposition "by" and NP being my noun phrase . 3 is the final state and i the initial .

all in all , i have come up with 10 automata .

I have searched java tutorials and automata-tutorials , non combine both !

yes, this is an assignement for my university and i am not asking that someone do it for me, i am frustrated, cause i dont know WHERE to look for information that could "shed some light" on this transformation process i.e how should i proceed with writing such algorithms ??

thx again in advance for ur reply

maya

PTrenholme 05-04-2008 08:37 AM

So, basically, you're asking "How do I program a FSM in JAVA?"

I don't use JAVA much (and my JAVA text is packed right now), but I do know that it implements an if statement and it may have a switch statement. I think you could program any FSM using either of those constructs.

You might find this WiKi article interesting, and these two FOSS projects suggestive: FSM Designer and FSM Generator.

mayaabboud 05-05-2008 06:08 AM

thx alot PTrenholme,

i appreciate your reply,

i couldnt open the projects, but the wiki article was helpful .

thx again

maya

PTrenholme 05-05-2008 06:39 AM

Strange. Those are standard SourceForge projects, and both open for me. The latest FSM generator claims to create JAVA code to implement a FSM, so running it may give you a good example of how a FSM could be coded.

Note, of course, that using generated code is not a good way to learn how to code.

mayaabboud 05-05-2008 06:58 AM

oh i just managed to open it with mozilla ...

thx again :)


All times are GMT -5. The time now is 07:35 PM.