Question: How to store text file data into a dictionary in JavaScript? I have having an issue with that part. In the text file, there's an

  • How to store text file data into a dictionary in JavaScript? I have having an issue with that part. In the text file, there's an english term and the spanish translations of the word. The dictionary key needs to be the english term and the values are the different spanish translations. 

     

    Below is just some of the lines from the file. 

    ###########################################################################
    #Copyright 1999 The Internet Dictionary Project/Tyler Chambers
    #http://www.june29.com/IDP/
    #This file is free to use and modify.  Thank you for using the IDP.
    #
    #Approximately 5048 entries.  9/21/97
    #Approximately 5488 entries.  1/7/98
    #Approximately 5910 entries.  3/8/98
    #Approximately 7450 entries.  2/19/99
    ###########################################################################
    a    un, uno, una[Article]
    aardvark    cerdo hormiguero
    aardvark    oso hormiguero[Noun]
    aardvarks    cerdos hormigueros
    aardvarks    osos hormigueros
    ab    prefijo que indica separacio/n
    aback    hacia atras
    aback    hacia atras,take aback, desconcertar. En facha.
    aback    por sopresa, desprevenidamente, de improviso
    aback    atra/s[Adverb]
    abacterial    abacteriano, sin bacterias
    abacus    a/baco
    abacuses    a/bacos
    abaft    A popa (towards stern)/En popa (in stern)
    abaft    detra/s de[Adverb]
    abalone    abulo/n
    abalone    oreja de mar (molusco)[Noun]
    abalone    oreja de mar[Noun]
    abalones    abulones
    abalones    orejas de mar (moluscos)[Noun]
    abalones    orejas de mar[Noun]
    abandon    abandonar
    abandon    darse por vencido[Verb]
    abandon    dejar
    abandon    desamparar, desertar, renunciar, evacuar, repudiar
    abandon    renunciar a[Verb]
    abandon    abandono[Noun]
    abandoned    abandonado
    abandoned    dejado
    abandoned    desamparado
    abandoned    olvidado
    abandoned    abandonada,abandonado, abandonados, abandonadas[Verb]
    abandonee    abandonado
    abandonee    aislado
    abandonee    dejado
    abandonee    desamparado
    abandonee    money
    abandoner    abandonador
    abandoning    abandonando
    abandoning    abandono
    abandonment    abandono

Step by Step Solution

3.41 Rating (145 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

Answer To store the data from your text file into a dictionary in JavaScript you can read the file l... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!