Cannot send string obtained by WordNet using flash

Asked 2 years ago, Updated 2 years ago, 124 views

I am currently using flash to use the top word I got from WordNet.
I'd like to send '.join(getWord(sense.wordid).lema) to Localhost by return.
With the current code, I'm thinking of calling getSynLinkRecursive with the function tekito and storing the array obtained there in the array a before sending it to the host. But if you check this a in print, it becomes None.
Please tell me how to store the characters in the a array.
I look forward to your kind cooperation.

Here are the possible source codes.

def getSynLinksRecursive(senses,link='hype',lang='jpn',_depth=0):
  y = [ ]
  x = [ ]
  for sense in senses:
    synLinks = getSynLinks (sense, link)
    ifsynLinks:
      y.append(''.join(getWord(sense.wordid).lemma))
    _senses=[ ]
    for synLink in syncLinks:
      sense=getSense(synLink.synset2,lang)
      if sense:
        _senses.append(sense)
    getSynLinksRecursive(_senses,link,lang,_depth+1)
  if_depth==1:
    x.append(y)
    # print(", ".join([str(j)for jinx]))
    return", ".join([str(j)for jinx])

#@app.route('/')
deftekito():
    a = [ ]
    words=getWords('Apple')
    senses = getSenses (words[0])
    link = 'hype'
    lang='jpn'
    a=getSynLinksRecursive(senses,link,lang)
    print(a)
    # print(", ".join([str(i)for i in a]))
    #return", ".join(a)

if__name__=='__main__':
  conn=sqlite3.connect("wnjpn.db", check_same_thread=False)
  tekito()
 app.run(debug=True)

python flask

2022-09-30 19:43

1 Answers

When getSynLinksRecursive is called without _depth, it does not return the value, so it becomes None.
getSynLinksRecursive should be fixed.


2022-09-30 19:43

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.