LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices

Reply
 
Search this Thread
Old 05-03-2008, 01:03 PM   #1
mayaabboud
Member
 
Registered: Oct 2007
Posts: 53

Rep: Reputation: 15
Unhappy 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
 
Old 05-03-2008, 01:53 PM   #2
PTrenholme
Senior Member
 
Registered: Dec 2004
Location: Olympia, WA, USA
Distribution: Fedora, (K)Ubuntu
Posts: 4,149

Rep: Reputation: 330Reputation: 330Reputation: 330Reputation: 330
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.

Last edited by PTrenholme; 05-03-2008 at 01:55 PM.
 
Old 05-03-2008, 02:22 PM   #3
mayaabboud
Member
 
Registered: Oct 2007
Posts: 53

Original Poster
Rep: Reputation: 15
Unhappy 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
 
Old 05-04-2008, 08:37 AM   #4
PTrenholme
Senior Member
 
Registered: Dec 2004
Location: Olympia, WA, USA
Distribution: Fedora, (K)Ubuntu
Posts: 4,149

Rep: Reputation: 330Reputation: 330Reputation: 330Reputation: 330
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.
 
Old 05-05-2008, 06:08 AM   #5
mayaabboud
Member
 
Registered: Oct 2007
Posts: 53

Original Poster
Rep: Reputation: 15
thx alot PTrenholme,

i appreciate your reply,

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

thx again

maya
 
Old 05-05-2008, 06:39 AM   #6
PTrenholme
Senior Member
 
Registered: Dec 2004
Location: Olympia, WA, USA
Distribution: Fedora, (K)Ubuntu
Posts: 4,149

Rep: Reputation: 330Reputation: 330Reputation: 330Reputation: 330
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.
 
Old 05-05-2008, 06:58 AM   #7
mayaabboud
Member
 
Registered: Oct 2007
Posts: 53

Original Poster
Rep: Reputation: 15
oh i just managed to open it with mozilla ...

thx again
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Java Programming: Java Runtime Environment not found when trying to compile murbz Linux - Software 2 03-26-2009 03:04 AM
Free Program (or OO Script) to throw Automata jabka Linux - Software 0 12-03-2007 12:02 PM
java support and programming with java sharapchi Slackware 8 11-14-2005 05:47 PM
java programming asahlot Programming 3 10-13-2005 10:30 AM
java programming ksd Programming 7 10-15-2003 06:29 PM


All times are GMT -5. The time now is 11:52 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration