Sponsored Content
Top Forums Shell Programming and Scripting Please suggest some changes in my code Post 302222903 by madhavsunduru on Thursday 7th of August 2008 10:59:45 PM
Old 08-07-2008
Hi Dhruva,

the command what you have suggest using only one grep is taking me more time than what i was using previously... Can you suggest me some other command which reduces exec time...
 

9 More Discussions You Might Find Interesting

1. AIX

Look into this and suggest if any changes needed

Hi, I am new script programming, I have written a script shown velow to read username and passwd from /etc/security/passwd, i am able to read username, but unable to grep lastupdate. please look into the code and suggest if any changes need. #!/bin/ksh USERNAME="" fname=/usr/bin/lastupdate... (1 Reply)
Discussion started by: me_haroon
1 Replies

2. UNIX for Advanced & Expert Users

Suggest me the easiest method

Hi, I want to check whether a file of the format myfile_YYYYMMDD_HHMMSS.txt exists in a particular directory. Here YYYYMMDD_HHMMSS is the time stamp, so it will be numbers always . What is the best method to do this I did it like this : ls myfile_*_*.txt but it will list files... (1 Reply)
Discussion started by: shihabvk
1 Replies

3. Shell Programming and Scripting

Can you suggest a more efficient way for this?

Hi I have the following at the end of a service shutdown script used in part of an active-passive failover setup: ### # Shutdown all primary Network Interfaces # associated with failover ### # get interface names based on IP's # and shut them down to simulate loss of # heartbeatd ... (1 Reply)
Discussion started by: mikie
1 Replies

4. UNIX for Advanced & Expert Users

suggest book

Hi I am new to Unix/Linux I know commands and shell scripts which are useful for my project. But i need to know the basics and commands and shell scripts in detail and easy guide. Please refer a book. Thanks Haripatn (6 Replies)
Discussion started by: haripatn
6 Replies

5. Shell Programming and Scripting

Can yum be used. If not please suggest.

Hi! I need to install a application from one server to several other servers. My script would copy the install-script to other machines and run it.Since it has to be non-interactive , just wondering if yum can be used for the same. Please let me know , if you guys are aware of other... (1 Reply)
Discussion started by: nua7
1 Replies

6. Shell Programming and Scripting

please suggest me a site

hi i need to get the values from an xml file like the <TAG> values and write to a file please suggest me the commands and some good reading material sites so that i can implement (1 Reply)
Discussion started by: perlamohan
1 Replies

7. UNIX for Advanced & Expert Users

Pls review this code and suggest if it can be written in a better way

Pls review this code and provide your feedbacks to make it more efficient.I have tried to add to each section. Code ############################################################### #!/bin/ksh RRSRC=/test RREP=/test #Directories test_dir=/test #Imp Files FILENAME=/test/files.txt #... (5 Replies)
Discussion started by: w020637
5 Replies

8. Shell Programming and Scripting

Any body suggest me.........!!!!

i am jaswanth, i am very new to unix/linux, upto now i worked in windows only., but i took coatching for unix.., and my sir teached all my classes in red hat linux and told me that all are same...!!! I know shall programming in red hat linux.., but now i installed opensloaris but the... (5 Replies)
Discussion started by: strgraphics
5 Replies

9. UNIX for Dummies Questions & Answers

Suggest books

Hi, I'm a beginner and am learning c programming. I want to learn UNIX/LINUX in parallel. But I don't know difference between UNIX and LINUX and where they are applied in real life. As a beginner, some people asked me to start with UNIX. Please let me know some very good books for UNIX. Also a... (6 Replies)
Discussion started by: nerdbee
6 Replies
hunspell(3)						     Library Functions Manual						       hunspell(3)

NAME
hunspell - spell checking, stemming, morphological generation and analysis SYNOPSIS
#include <hunspell/hunspell.hxx> /* or */ #include <hunspell/hunspell.h> Hunspell(const char *affpath, const char *dpath); Hunspell(const char *affpath, const char *dpath, const char * key); ~Hunspell(); int add_dic(const char *dpath); int add_dic(const char *dpath, const char *key); int spell(const char *word); int spell(const char *word, int *info, char **root); int suggest(char***slst, const char *word); int analyze(char***slst, const char *word); int stem(char***slst, const char *word); int stem(char***slst, char **morph, int n); int generate(char***slst, const char *word, const char *word2); int generate(char***slst, const char *word, char **desc, int n); void free_list(char ***slst, int n); int add(const char *word); int add_with_affix(const char *word, const char *example); int remove(const char *word); char * get_dic_encoding(); const char * get_wordchars(); unsigned short * get_wordchars_utf16(int *len); struct cs_info * get_csconv(); const char * get_version(); DESCRIPTION
The Hunspell library routines give the user word-level linguistic functions: spell checking and correction, stemming, morphological generation and analysis in item-and-arrangement style. The optional C header contains the C interface of the C++ library with Hunspell_create and Hunspell_destroy constructor and destructor, and an extra HunHandle parameter (the allocated object) in the wrapper functions (see in the C header file hunspell.h). The basic spelling functions, spell() and suggest() can be used for stemming, morphological generation and analysis by XML input texts (see XML API). Constructor and destructor Hunspell's constructor needs paths of the affix and dictionary files. See the hunspell(4) manual page for the dictionary format. Optional key parameter is for dictionaries encrypted by the hzip tool of the Hunspell distribution. Extra dictionaries The add_dic() function load an extra dictionary file. The extra dictionaries use the affix file of the allocated Hunspell object. Maximal number of the extra dictionaries is limited in the source code (20). Spelling and correction The spell() function returns non-zero, if the input word is recognised by the spell checker, and a zero value if not. Optional reference variables return a bit array (info) and the root word of the input word. Info bits checked with the SPELL_COMPOUND, SPELL_FORBIDDEN or SPELL_WARN macros sign compound words, explicit forbidden and probably bad words. From version 1.3, the non-zero return value is 2 for the dictionary words with the flag "WARN" (probably bad words). The suggest() function has two input parameters, a reference variable of the output suggestion list, and an input word. The function returns the number of the suggestions. The reference variable will contain the address of the newly allocated suggestion list or NULL, if the return value of suggest() is zero. Maximal number of the suggestions is limited in the source code. The spell() and suggest() can recognize XML input, see the XML API section. Morphological functions The plain stem() and analyze() functions are similar to the suggest(), but instead of suggestions, return stems and results of the morphological analysis. The plain generate() waits a second word, too. This extra word and its affixation will be the model of the morphological generation of the requested forms of the first word. The extended stem() and generate() use the results of a morphological analysis: char ** result, result2; int n1 = analyze(&result, "words"); int n2 = stem(&result2, result, n1); The morphological annotation of the Hunspell library has fixed (two letter and a colon) field identifiers, see the hunspell(4) manual page. char ** result; char * affix = "is:plural"; // description depends from dictionaries, too int n = generate(&result, "word", &affix, 1); for (int i = 0; i < n; i++) printf("%s0, result[i]); Memory deallocation The free_list() function frees the memory allocated by suggest(), analyze, generate and stem() functions. Other functions The add(), add_with_affix() and remove() are helper functions of a personal dictionary implementation to add and remove words from the base dictionary in run-time. The add_with_affix() uses a second word as a model of the enabled affixation of the new word. The get_dic_encoding() function returns "ISO8859-1" or the character encoding defined in the affix file with the "SET" keyword. The get_csconv() function returns the 8-bit character case table of the encoding of the dictionary. The get_wordchars() and get_wordchars_utf16() return the extra word characters definied in affix file for tokenization by the "WORDCHARS" keyword. The get_version() returns the version string of the library. XML API The spell() function returns non-zero for the "<?xml?>" input indicating the XML API support. The suggest() function stems, analyzes and generates the forms of the input word, if it was added by one of the following "SPELLML" syntaxes: <?xml?> <query type="analyze"> <word>dogs</word> </query> <?xml?> <query type="stem"> <word>dogs</word> </query> <?xml?> <query type="generate"> <word>dog</word> <word>cats</word> </query> <?xml?> <query type="generate"> <word>dog</word> <code><a>is:pl</a><a>is:poss</a></code> </query> The outputs of the type="stem" query and the stem() library function are the same. The output of the type="analyze" query is a string contained a <code><a>result1</a><a>result2</a>...</code> element. This element can be used in the second syntax of the type="generate" query. EXAMPLE
See analyze.cxx in the Hunspell distribution. AUTHORS
Hunspell based on Ispell's spell checking algorithms and OpenOffice.org's Myspell source code. Author of International Ispell is Geoff Kuenning. Author of MySpell is Kevin Hendricks. Author of Hunspell is Laszlo Nemeth. Author of the original C API is Caolan McNamara. Author of the Aspell table-driven phonetic transcription algorithm and code is Bjorn Jacke. See also THANKS and Changelog files of Hunspell distribution. 2011-02-01 hunspell(3)
All times are GMT -4. The time now is 03:50 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy