473,395 Members | 1,938 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

Splitting a string

Hi

I have BROWN Corpus File, where i need to write a code for " To convert a String of sentence into a parse tree" .

Thanks in advance
Vasu
Mar 26 '07 #1
12 1254
KevinADC
4,059 Expert 2GB
Thank you for sharing that exciting news with us. Let us know when you get the code done. :)


Or are you asking for help writing the code?
Mar 26 '07 #2
Hi

Thanks for your reply.. Kevin
I am trying to write a code for it. I appreciate if anyone is helping me..

Thank in advance
Vasu


Thank you for sharing that exciting news with us. Let us know when you get the code done. :)


Or are you asking for help writing the code?
Mar 26 '07 #3
KevinADC
4,059 Expert 2GB
well...... lets see your code. ;)
Mar 26 '07 #4
I was trying to use "use Parse::RecDescent" in my code. But there is an error. I was using Perl Express... editor

well...... lets see your code. ;)
Mar 26 '07 #5
KevinADC
4,059 Expert 2GB
I give up :(
Mar 26 '07 #6
miller
1,089 Expert 1GB
vasu vasu vasu,

Why must you try Kevin's patience so?

He asked to see your code two times, and both times you both acknowledged and then ignored his request. You will never be able to get help unless you listen to the questions that experts ask you.

You say there is an error using a particular module. Where is the code using this module? What exactly was the error?

This is vital information that anyone would need in order to help you. This is the fourth thread you've started that we had to pound information out of you.

This wastes both our and your time.
- Mille
Mar 27 '07 #7
Hi I m sorry, Kevin

I jus a code online I m trying to work..... Please go through it ...

Expand|Select|Wrap|Line Numbers
  1. #!/usr/bin/perl
  2. use Parse::RecDescent;
  3.  
  4. # Create and compile the source file
  5. $parser = Parse::RecDescent->new(q(
  6. startrule : day month /\d+
  7.      day : "Sat" | "Sun" | "Mon" | "Tue" | "Wed" | "Thu" | "Fri"
  8.      month : "Jan" | "Feb" | "Mar" | "Apr" | "May" | "Jun" | "Jul" | "Aug" | "Sep" | "Oct" | "Nov" | "Dec"
  9. ));
  10. #Test it on sample data
  11. print "Valid date\n" if $parser->startrule("Thu Mar 31");
  12. print "Invalid date\n" unless $parser->startrule("Jun 31 2000");
  13.  
Thanks
Vasu
well...... lets see your code.
Mar 27 '07 #8
Hi Miller,

I am Sorry for that......I dont know.... I got the code from online..........

Here is the code....

Expand|Select|Wrap|Line Numbers
  1. #!/usr/bin/perl
  2. use Parse::RecDescent;
  3.  
  4. # Create and compile the source file
  5. $parser = Parse::RecDescent->new(q(
  6. startrule : day month /\d+
  7.      day : "Sat" | "Sun" | "Mon" | "Tue" | "Wed" | "Thu" | "Fri"
  8.      month : "Jan" | "Feb" | "Mar" | "Apr" | "May" | "Jun" | "Jul" | "Aug" | "Sep" | "Oct" | "Nov" | "Dec"
  9. ));
  10. #Test it on sample data
  11. print "Valid date\n" if $parser->startrule("Thu Mar 31");
  12. print "Invalid date\n" unless $parser->startrule("Jun 31 2000");
  13.  
Thanks
Vasu



vasu vasu vasu,

Why must you try Kevin's patience so?

He asked to see your code two times, and both times you both acknowledged and then ignored his request. You will never be able to get help unless you listen to the questions that experts ask you.

You say there is an error using a particular module. Where is the code using this module? What exactly was the error?

This is vital information that anyone would need in order to help you. This is the fourth thread you've started that we had to pound information out of you.

This wastes both our and your time.
- Mille
Mar 27 '07 #9
miller
1,089 Expert 1GB
I am Sorry for that......I dont know.... I got the code from online..........
Hi Vasu,

Thank you for finally showing us the code.

However I'm sorry, but I'm not here to teach you perl. If you are writing code yourself, then we are certainly willing to help you diagnose a bug that is stumping you. Or we can help you come up with an approach that you wouldn't think of. But we are not here to decipher and explain someone else's code to you.

I suggest that you start reading about perl in many of the online resources publically available. Here's two good places to start:

perldoc perlintro
perlmonks Getting started with Perl

Regards,
- Miller
Mar 27 '07 #10
Thank you Miller.

I can first start learning perl and then start coding few small examples

Regards
Vasu


Hi Vasu,

Thank you for finally showing us the code.

However I'm sorry, but I'm not here to teach you perl. If you are writing code yourself, then we are certainly willing to help you diagnose a bug that is stumping you. Or we can help you come up with an approach that you wouldn't think of. But we are not here to decipher and explain someone else's code to you.

I suggest that you start reading about perl in many of the online resources publically available. Here's two good places to start:

perldoc perlintro
perlmonks Getting started with Perl

Regards,
- Miller
Mar 27 '07 #11
KevinADC
4,059 Expert 2GB
Parse::RecDescent is generally not installed, so you may have to install it if you intend to use it. Not an easy module to use either. If you want or need to use it, bookmark this page:

http://search.cpan.org/~tbone/Parse-...AQ-5.00/FAQ.pm
Mar 27 '07 #12
Thank You Kevin
I will install and use in my code.

Thanks
Vasudha


Parse::RecDescent is generally not installed, so you may have to install it if you intend to use it. Not an easy module to use either. If you want or need to use it, bookmark this page:

http://search.cpan.org/~tbone/Parse-...AQ-5.00/FAQ.pm
Mar 28 '07 #13

Sign in to post your reply or Sign up for a free account.

Similar topics

6
by: qwweeeit | last post by:
Splitting with RE has (for me!) misterious behaviour! I want to get the words from this string: s= 'This+(that)= a.string!!!' in a list like that considering "a.string" as a word. Python...
5
by: fatted | last post by:
I'm trying to write a function which splits a string (possibly multiple times) on a particular character and returns the strings which has been split. What I have below is kind of (oh dear!)...
4
by: JeffM | last post by:
Quick C# question: I have comma delimited values in a string array that I want to pass to seperate variables. Any tips on splitting the array? Thanks in advance! JM
2
by: Trint Smith | last post by:
Ok, My program has been formating .txt files for input into sql server and ran into a problem...the .txt is an export from an accounting package and is only supposed to contain comas (,) between...
20
by: Opettaja | last post by:
I am new to c# and I am currently trying to make a program to retrieve Battlefield 2 game stats from the gamespy servers. I have got it so I can retrieve the data but I do not know how to cut up...
2
by: CharChabil | last post by:
Using Vb.net 2005, I want to read each part in this string in an array (splitting the string) ----------- A1/EXT "BK82 LB73 21233" 105 061018 1804 ----------- That Code that i used is as follow:...
6
by: HMS Surprise | last post by:
The string s below has single and double qoutes in it. For testing I surrounded it with triple single quotes. I want to split off the portion before the first \, but my split that works with...
2
by: shadow_ | last post by:
Hi i m new at C and trying to write a parser and a string class. Basicly program will read data from file and splits it into lines then lines to words. i used strtok function for splitting data to...
4
by: yogi_bear_79 | last post by:
I have a simple string (i.e. February 27, 2008) that I need to split into three parts. The month, day, and year. Splitting into a string array would work, and I could convert day and years to...
37
by: xyz | last post by:
I have a string 16:23:18.659343 131.188.37.230.22 131.188.37.59.1398 tcp 168 for example lets say for the above string 16:23:18.659343 -- time 131.188.37.230 -- srcaddress 22 ...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.