Need your opinion: Is there a short method

Discussion in 'Programming' started by adsensedoctor, Feb 27, 2009.

  1. #1
    I want to develop a list of synonyms in following way:

    " abrasive " => " material ",
    " abrasiveness " => " roughness ",
    " abridge " => " shorten ",
    " abridged " => " shortened ",

    Is there any way (tool,php cod, excel etc.) with the help of which I can transform a list of synonyms separated by comma in above format.

    I mean Is there any way to transform

    to this one

    with the help of some tool etc.

    Need you help
     
    adsensedoctor, Feb 27, 2009 IP
  2. amerigohosting

    amerigohosting Peon

    Messages:
    255
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #2
    
    #!/usr/bin/perl
    $filename="filename.txt";
    open (TEXTFILE, "$filename") or die "can't open $filename\n";
    for(<TEXTFILE>){$_=~s/( |\n)//g;($word1,$word2)=split(",",$_);print "\"$word1\" => \"$word2\"\n"}
    
    Code (markup):
     
    amerigohosting, Feb 27, 2009 IP
  3. adsensedoctor

    adsensedoctor Peon

    Messages:
    106
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    0
    #3
    thanks for your help. I don't know programing can you please tell me how to use this too. please
     
    adsensedoctor, Feb 28, 2009 IP