Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

295
Views
Error de referencia: RiLexicon no está definido

Estoy tratando de escribir un código en p5.js y no puedo entender por qué el siguiente código arroja el error:

Error de referencia no detectado: RiLexicon no está definido

mySketch, línea 18: No se pueden leer las propiedades de undefined (leyendo 'isNoun')

Encendí la biblioteca RiTa.js pero no funciona. Espero que alguien pueda dar una idea.

 let poem = "STOPPING BY WOODS ON A SNOWY EVENING WHOSE woods these are I think I know. His house is in the village though; He will not see me stopping here To watch his woods fill up with snow. My little horse must think it queer To stop without a farmhouse near Between the woods and frozen lake The darkest evening of the year. He gives his harness bells a shake To ask if there is some mistake. The only other sound's the sweep Of easy wind and downy flake. The woods are lovely, dark and deep. But I have promises to keep, And miles to go before I sleep, And miles to go before I sleep." let words; let newPoem = ""; var lexicon = new RiLexicon(); function setup() { createCanvas(windowWidth, windowHeight); background(100); // tokenize the poem string to words words = RiTa.tokenize(poem); // replace all nouns and adjectives in the text with random nouns and adjectives. // loop through all the words for (i=0; i<words.length; i++){ let currentWord = words[i]; // when the word is a noun if (lexicon.isNoun(currentWord)){ // generate a new noun and use that as current word currentWord = lexicon.randomWord("nn"); } // when the word is an adj else if (lexicon.isAdjective(currentWord)){ // generate a new adj and use that as current word currentWord = lexicon.randomWord("jj"); } // add the word to the new poem newPoem += currentWord + " "; } print(newPoem); } function draw() { textSize(16); // display the new poem text(newPoem, width/20, height/4, 500, 800); }
about 4 years ago · Juan Pablo Isaza
2 answers
Answer question

0

Estoy bastante seguro de que RiLexicon está obsoleto en RiTa 2, ya que lo acabo de leer en una actualización de un tutorial anterior que he estado haciendo. No puedo darle una respuesta definitiva ya que solo he estado usando RiTa durante aproximadamente 2 horas. ¡Encontré su pregunta al buscar en Google información sobre sus alternativas! RiTa.randomWord podría hacerlo, p.

about 4 years ago · Juan Pablo Isaza Report

0

RiLexicon está en desuso en v2.x, pero todas las funciones aún existen; solo se accede a ellas en forma de RiTa.functionName():

  • RiTa.esSustantivo()
  • RiTa.esAdjetivo()
  • RiTa.palabra aleatoria()
  • RiTa.tokenizar()

La referencia para la versión 2.x está aquí: https://rednoise.org/rita/#reference

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!