Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

175
Visualizações
Comparing two strings, find the indexes of added words, ignoring "edited" words

Is it possible? With no library's or memory of the changes as they're made?

The example I'm showing below is probably more edited than the text I will be evaluating (although much shorter). For my use case, I will be editing a transcription that is usually very accurate and I need to be able to know if a new word is added & where so I can approximate a timecode for the new word, as well as shift the existing timecodes forwards to combat the offset that the new word has created.

originalString = "Hello, this sum example txt. Hopefully this is possible!";
editedString = "Hello, this is some example text. Maybe this is not impossible.";

//The edited words are: "sum/some", "txt/text", "Hopefully/Maybe", "possible/impossible"
//It would be useful to get the edited words also - but not essential

//the new words are: "is", "not"
//Output would be
newWordIdxs = [2, 9];

First post here and have only been coding for 3 or 4 months so any tips on how to ask better questions are very welcome.

about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

How to estimate an word was edited? According to the example you posted, the word 'some' may be added, and 'sum' is removed. It's more logical to find which word or character is removed or added by excluding the same words or characters in sequence. This javascript library may help , https://www.npmjs.com/package/diff

about 4 years ago · Juan Pablo Isaza Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda