Mario Bonassin

Greenhorn
+ Follow
since Apr 08, 2004
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Mario Bonassin

I've tried all those and it doesn't write a whole document.
FileWriter(document) doesn't work.
Is there something I need to do to the Document of a JTextComponent to make it saveable. Do I need to convert the entire doc to a string and then write each string or can I somehow write the doc as a whole?
this is the document i'm talking about.
http://java.sun.com/j2se/1.4.2/docs/api/javax/swing/text/Document.html
20 years ago
I'm trying to write a save action that will write a Document from a JTextComponent to a txt file. I can't seem to figure it out. I've looked at the API and that hasn't gotten me anywhere.
any suggestions
Mario
20 years ago
Thanks a lot, that has worked beautifully.
Mario
20 years ago
Ok I've exhausted everything I could think of to do this simple thing. I want to get ride of all the duplicate entries in one list. but every way I try it I get more duplicate entries.
heres the most recent version of what I'm trying to do

any suggestions??
Thanks
Mario
20 years ago
The text is in a JTextComponent too. thats what the document is.
20 years ago
How would I write a writer version of the following


I'm not familiar with Documents, I've read the api and its confusing me. I just want it to write the doc to a txt file.
thanks
20 years ago
I've tried include, includes, and includesfile and none seemed to work. I assume that they are supposed to be withing the <jar> section right? I don't know what I'm doing wrong.
Mario
20 years ago
Mostly its with the meat of the program. I can do the GUI without much problem, but I have trouble creating the I/O and then figuring out how to actually apply the rules to the input. Any assistance or advice would be of help. If you know VB you could even look at what Lee did and convert that to java.
I also have another program I've writen that I'd eventually like to integrate into Phono. But this isn't a priority.

Mario
Well this program is geared towards linguistics. What it does is say take a latin word /morte/ then apply the sound changes that occured through history to arrive at its present day spanish version /muerte/. It allows linguists who are studying or are trying to derive a proto-language to test their ideas.
For me one of my hobbies is language creation. I can create a proto-lang and then use it to get current forms of the language. The most famous example would be Tolkiens Primitive Elvish to Sindarin and Quenya.
Here is an example of a rule.

the basic idea is that each rule is an If/Then statement. The letters are the IF's and the numbers the Then's.
I posted an old Doc at
http://www.conlang.net/stuff/docs.htm
This program was originally written by Lee Hartman, Emeritus, Department of Foreign Languages & Literatures at Southern Illinois University�Carbondale. I have worked with him on his Visual Basic version. I don't know VB and he was self teaching himself. I originally started this project to help me learn Java but its gotten too complicated for me alone. I have his permission and support to create a Java version of the program. You can see what he has done at
http://mypage.siu.edu/lhartman/
I hope this helps, if you have any more questions please ask.
Thanks
Mario
I'm trying to include a file into a build that can then be read by the program. Here is my build.xml

and here is the code thay should be able to read a file called 'HELP'

When i compile normally it sees the file fine but how do I include it in the jar.
Thanks
20 years ago
How do I get my app to run on Mac OS 9? Is there something I need to code or can they just double click the .jar file?
Thanks
20 years ago
Thanks that got me on the right track. But why does it go through the first loop twice?
Here the code:

if the word /dhazaaz/ is passed, and the two letter to remove are /d/ and /z/ the println give the following
[z, d] 2 0
dhazaaz dhazaaz 0 false false
dhaaaz dhaaaz 1 false false
dhaaa dhaaa 2 false true
[z, d] 2 1
haaaz haaaz 0 true false
[z, d] 2 0
dhaaa dhaaa 0 false true
[z, d] 2 1
haaaz haaaz 0 true false
dhaaaz final fix

It gives the correct word but it goes through the process twice, why?
Thanks
Mario
ps if anyone has a better way of doing this let me know thanks.
20 years ago
I tried those and they didn't do the job either. Substring() just gives back part of the word not a specific character. IndexOf() returns a int not a String so it can't be matched. At least I don't know how to do it.
As to replaceAll() I looked at that and I don't want every instance of the letter to be replaced. I want to pick and choose which will be replaced. Thats why I tried the replace(), but it uses char instead of strings.
20 years ago
Ok I've spent the last couple of days trying to figure this one out. Heres what I'm trying to do:
I have a string 'boothzan'.
I have a set of rules to apply to this string 'z only appears at the beginning or end of a word'
How do I have it go through the word and take out the letter 'z' creating the word 'boothan'?
The rules are being read in from a text file. Heres what I have
char space = '*';
for (a = 0; a < dropAll.size(); ++a) {
String drop = dropAll.get(a).toString();
for (b = 0; b< word.length(); ++b) {
if (drop.charAt(0) == word.charAt(b)) {
word.replace(word.charAt(b), space);
}
}
}
This doesn't work and I'm at a lose as to why. I also don't want to put the '*' in but I can't figure out how to remove anything. Also there are times when the character to be replace is something like 'th' or 'eks'. Using the /drop.charAt(0)/ won't work for that. As well this way doesn't allow for the letter to exist in a specific positions.
The words are all different so it needs to be flexible.
If you could at least point me in the right direction that would be great.
Thanks
20 years ago
I have no idea how to do this one. I need a simple code that will take a listModel and alphabetize the items. I would like it if it could do it with the first letter and last letter, seperatly of course.
Any suggestions or advise would be great.
Mario
20 years ago