Sponsored Content
Top Forums Shell Programming and Scripting extract words with even numbr of letters Post 302168667 by manish205 on Tuesday 19th of February 2008 06:05:38 AM
Old 02-19-2008
Java extract words with even numbr of letters

Hello All

I need to extract words which are of even number of letters and not greater than 10.

Any help??

Thanks,
Manish
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Extract words to new file

Hi there, Unix Gurus Working with big listings of english sentences for my pupils, of the type: 1. If the boss's son had been , someone would have asked for money by now. 2. Look, I haven't a crime, so why can't you let me go? .... I wondered how to extract the words between brackets in... (7 Replies)
Discussion started by: eldeingles
7 Replies

2. Shell Programming and Scripting

ENQUIRY WHETHER SCRIPT FOR DETECTING WORDS FROM A SET OF LETTERS EXISTS

Hello, I am interested in finding out whether someone has a perl or awk script which takes a set of letters such as wak and referring to a dictionary spews out all possible forms such as awk, kaw etc. If someone has such a script, could it be put up please. The script should handle Unicode. Many... (0 Replies)
Discussion started by: gimley
0 Replies

3. UNIX for Dummies Questions & Answers

Grep.Need help with finding the words which start at [A-K] letters in thesecond column of the table

Hi buddies ! I need some help with one grep command :) I have this table: 1 Petras Pavardenis 1980 5 08 Linas Bajoriunas 1970 10 3 Saulius Matikaitis 1982 2 5 Mindaugas Stulgis 1990... (1 Reply)
Discussion started by: vaidastf
1 Replies

4. Shell Programming and Scripting

AWK count letters words

Hi All! can anyone help me with this code? I want to count words or letters in every line with if(count>20){else echo $myline} awk '/<script /{p=1} /<\/script>/{p=0; next}!p' index.html | while read myline; do echo $myline done Thank you !!! (3 Replies)
Discussion started by: sanantonio7777
3 Replies

5. Shell Programming and Scripting

Find and arrange words with same letters from list

I am making a word game and I am wondering how to find and arrange words in a list that have the same letters. In my game, you are presented with 5 letters, and you then have to rearrange the letters tp make a word. So the word could be "acorn", but those 5 letters could also make up "narco" or... (2 Replies)
Discussion started by: hellobard
2 Replies

6. UNIX for Dummies Questions & Answers

sed - extract a group of Letters/numbers

I have a file with hundreds of lines in it. I wanted to extract anything that matches the following: KR followed by 4 digits: example KR1201 cat list | sed "s///g" Is the closest I've come, and obviously it is not what I want. This would remove all of the items that I want and leave me... (2 Replies)
Discussion started by: newbie2010
2 Replies

7. Shell Programming and Scripting

Extract distinc sequence of letters

Hallo, I need to extract distinct sequence of letters for example from 136 to 193 Files are quite big, so I would prefer not to use "fold -w1" Thank you very much Input file look like this: 1 cttttacctt catgtgtttt tgcagatatt tgttcataat aacatcttct ttttaagtta 61 ttaaaatctt... (4 Replies)
Discussion started by: kamcamonty
4 Replies

8. Shell Programming and Scripting

Extract words before and after a certain word.

I have a sample text file with file name: sample.txt The text file has the following text. this is an example text where we have to extract certain words before and after certain word these words can be used later to get more information I want to extract n (a constant) words before and... (2 Replies)
Discussion started by: shoaibjameel123
2 Replies

9. Shell Programming and Scripting

Find words containing small letters

Hello, I have a file containing different words. How can i print the words which contain at least one small letter, for example if i have: today TOMORROw 12345 123a next preViou5 no it should print the following: today TOMORROw 123a next preViou5 no Please use code tags as required... (5 Replies)
Discussion started by: JhonTheNewbie
5 Replies

10. UNIX for Beginners Questions & Answers

Extract Bracketed Words

Hi there, Unixers I need to extract ALL the words from a text which aresurrounded by square brackets. I am using this piece of code sed 's/.*\.*/\1/g' inputfile > outputfile but I only get one word for every paragraph, why? Please use CODE tags as required by forum rules! (7 Replies)
Discussion started by: eldeingles
7 Replies
FOO(1)								     Commands								    FOO(1)

NAME
wordplay - anagram finder SYNOPSIS
wordplay string [-slxavnmd] [-w word] [-f wordfile] DESCRIPTION
wordplay is an anagram finder. What is an anagram? Well, let's turn to Merriam-Webster's Collegiate Dictionary, Tenth Edition: anagram: a word or phrase made by transposing the letters of another word or phrase. Each letter in the anagram must appear with the same frequency as in the original string. For example, the letters in the word "stop" can be rearranged to spell "tops" or "pots" or "sotp". "sotp" is not a word and is not of interest when generating anagrams. "stop" has four letters, so there are 24 ways to rearrange its letters. However, very few of the re- arrangements actually spell words. Wordplay, by using a list of words, takes a specified string of letters and uses the list of words to find anagrams of the string. By the way, "Wordplay" anagrams to "Rowdy Pal", and the program really can live up to that particular anagram. I have been able to come up with anagrams of most of my coworkers' names that are humorous, descriptive, satirical, or, occasionally, quite vulgar. OPTIONS
string String to be anagrammed. This should be seen to the program as a single argument. If you feel you must put spaces in the string, under UNIX, you will have to put backslashes in front of the spaces or just put the entire string in double quotes. Just leave the spaces out because the program throws them out anyway. -s Silent operation. If this option is used, the header and line numbers are not printed. This is useful if you want the output to contain only the anagrams. Use this option with the l (and x) option to generate a wordlist which can be piped or redirected. This option does not suppress error messages that are printed to stderr. Finding zero anagrams is not an error. -l Print list of candidate words before anagramming. This is the list of words that can be spelled with the letters from the specified string, with no letters being used more often that they appear in the input string. -x Do not perform anagramming. Use with l if you just want the candidate word list without anagrams. -a Allow anagrams containing two or more occurrences of a word. -v Consider strings with no vowels as candidate words and do not give up when there are no vowels remaining after extractions. -m Limit candidate word length to a maximum number of letters. Follow by an integer. m12 means limit words to 12 letters. m5 means limit them to 5 letters. -n Limit candidate word length to a minimum number of letters. Follow by an integer. n2 means limit words to 2 letters. n11 means limit them to 11 letters. -d Limit number of words in anagrams to a maximum number. Follow by an integer. d3 means no anagrams should contain more than 3 words. d12 means limit anagrams to 12 words. This is currently the option that I recommend to limit output, since an optimization has been added to speed execution in some cases when this option is used. -w Specify a word which should appear in all anagrams. This is useful if you already have a word in mind that you want in the ana- grams. This option should be specified at the end of the command, followed by a space and the word to use. -f Specify which word list to use. See example! This option should be specified at the end of the command, followed by a space and the alternate wordfile name. This is useful if you have other word lists to try or if you are interested in making your own custom- ized word list. New feature: Use a hyphen as the filename if the wordlist should be read from stdin. EXAMPLES
wordplay persiangulf Anagram the string "persiangulf" . wordplay anagramming -lx Print the list of words from the wordlist that can be spelled by using the letters from the word "anagramming". A letter may not be used more often than the number of times it occurs in the word "anagramming". No anagrams are generated. wordplay tomservocrow -n3m8 Anagram the string "tomservocrow" . Do not use words shorter than 3 letters or longer than 8 letters. wordplay persiangulf -ld3m10 -f /usr/share/dict/words Print the candidate words for the string "persiangulf". Print anagrams containing up to 3 words, without considering any words longer than 10 characters. Use the file "/usr/share/dict/words" rather than "words721.txt". wordplay soylentgreen -n3w stolen -f w2 Print anagrams of "soylentgreen" containing the word "stolen" and use the file "w2" as the wordlist file. Discard candidate words shorter than 3 characters. wordplay university -slx Print the candidate word list for the string "university". The output will consist of just the words. This output is more useful for redirecting to a file or for piping to another program. wordplay trymeout -s Anagram the string "trymeout" and print the anagrams with no line numbers. The header will not be printed. This is useful for pip- ing the output to another process (or saving it to a file to be used by another program) without having to parse the output to remove the numbers and header. wordplay trymeout -v Anagram "trymeout" as usual, but in case vowel-free strings are in the wordlist, consider them as possible candidate words. cat wordlist1 wordlist2 wordlist3 | sort -u | wordplay trymeout -f - Anagram "trymeout" and read the wordlist from stdin, so that, in this case, the three wordlists "wordlist1", "wordlist2", and "wordlist3" will be concatenated and piped into wordplay as the wordlist. The "sort -u" is there to remove duplicate words from the combined wordlist. NOTES
If the option specifiers are combined, as in "an7m7d5f" or "d3n5f", the f should come last, followed by a space and the word list file. The "w" option is used in the same manner. Limit the number of words to consider, if desired, using the n and m options, or better yet, use the d option to limit depth, when anagram- ming certain time-consuming strings. The program is currently optimized to speed execution in some cases when the d option is used. It is highly recommended that the "words721.txt" file distributed with the program be used, since many nonsense two and three-letter combi- nations that are not words have been eliminated. This makes the quality of the output slightly better and speeds execution of the program a slight bit. Any word list may be used, as long as there is one word per line. Feel free to create your own custom word list and use it instead. The word list does not have to be sorted in any particular way. FILES
/usr/share/games/wordplay/words721.txt Default word list file. DISTRIBUTION
This program was written for fun and is free. Distribute it as you please, but please distribute the entire package, with the original words721.txt and the readme file. If you modify the code, please mention my name in it as the original author. Please send me a copy of improvements you make, because I may include them in a future version. AUTHOR
Wordplay was written by Evans A Criswell <criswell@cs.uah.edu> This man page was written by Joey Hess <joeyh@debian.org> DECEMBER 1996 FOO(1)
All times are GMT -4. The time now is 09:22 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy