Diff
checker
Texto
Texto
Imagens
Documentos
Excel
Pastas
Legal
Enterprise
Aplicativo para desktop
Preços
Fazer login
Baixar o Diffchecker Desktop
Comparar texto
Encontre a diferença entre dois arquivos de texto
Ferramentas
Histórico
Editor live
Recolher inalteradas
Sem quebra de linha
Layout
Dividido
Unificado
Nível de detalhe
Inteligente
Palavra
Caractere
Realce de sintaxe
Escolher sintaxe
Ignorar
Transformar texto
Ir à primeira mudança
Editar entrada
Diffchecker Desktop
A maneira mais segura de usar o Diffchecker. Obtenha o aplicativo Diffchecker Desktop: seus diffs nunca saem do seu computador!
Obter Desktop
Untitled diff
Criado
há 7 anos
O diff nunca expira
Limpar
Exportar
Compartilhar
Explicar
35 remoções
Linhas
Total
Removido
Caracteres
Total
Removido
Para continuar usando este recurso, atualize para
Diff
checker
Pro
Ver preços
60 linhas
Copiar tudo
25 adições
Linhas
Total
Adicionado
Caracteres
Total
Adicionado
Para continuar usando este recurso, atualize para
Diff
checker
Pro
Ver preços
52 linhas
Copiar tudo
Copiar
Copiado
Copiar
Copiado
const
algorithmia
= require(
'algorithmia'
)
import
algorithmia
from
'algorithmia'
;
const algorithmiaApiKey = require('../credentials/algorithmia.json').apiKey
const algorithmiaApiKey = require('../credentials/algorithmia.json').apiKey
Copiar
Copiado
Copiar
Copiado
const
sentenceBoundaryDetection
= require(
'sbd'
)
import
sentenceBoundaryDetection
from
'sbd'
;
import { IContent } from './robots.api';
Copiar
Copiado
Copiar
Copiado
async function robot(content
) {
async function robot(content
: IContent
) {
await fetchContentFromWikipedia(content)
await fetchContentFromWikipedia(content)
sanitizeContent(content)
sanitizeContent(content)
breakContentIntoSentences(content)
breakContentIntoSentences(content)
Copiar
Copiado
Copiar
Copiado
async function fetchContentFromWikipedia(content
) {
async function fetchContentFromWikipedia(content
: IContent
) {
const algorithmiaAuthenticated = algorithmia(algorithmiaApiKey)
const algorithmiaAuthenticated = algorithmia(algorithmiaApiKey)
const wikipediaAlgorithm = algorithmiaAuthenticated.algo('web/WikipediaParser/0.1.2')
const wikipediaAlgorithm = algorithmiaAuthenticated.algo('web/WikipediaParser/0.1.2')
const wikipediaResponde = await wikipediaAlgorithm.pipe(content.searchTerm)
const wikipediaResponde = await wikipediaAlgorithm.pipe(content.searchTerm)
Copiar
Copiado
Copiar
Copiado
const
wikipediaContent
= wikipediaResponde.get()
const
{
wikipediaContent
}
= wikipediaResponde.get()
content.sourceContentOriginal = wikipediaContent
.content
content.sourceContentOriginal = wikipediaContent
}
}
Copiar
Copiado
Copiar
Copiado
function sanitizeContent(content
) {
function sanitizeContent(content
: IContent
) {
const withoutBlankLinesAndMarkdown = removeBlankLinesAndMarkdown(content.sourceContentOriginal)
const withoutBlankLinesAndMarkdown = removeBlankLinesAndMarkdown(content.sourceContentOriginal)
const withoutDatesInParentheses = removeDatesInParentheses(withoutBlankLinesAndMarkdown)
const withoutDatesInParentheses = removeDatesInParentheses(withoutBlankLinesAndMarkdown)
content.sourceContentSanitized = withoutDatesInParentheses
content.sourceContentSanitized = withoutDatesInParentheses
Copiar
Copiado
Copiar
Copiado
function removeBlankLinesAndMarkdown(text
)
{
function removeBlankLinesAndMarkdown(text
: string): string
{
const allLines = text.split('\n')
const allLines = text.split('\n')
Copiar
Copiado
Copiar
Copiado
const
withoutBlankLinesAndMarkdown = allLines.
filter
(
(line
) =>
{
const
filter
Func =
(line
: string
) =>
if
(line.trim().length === 0 || line.trim().startsWith('='))
{
!
(line.trim().length === 0 || line.trim().startsWith('='))
return false
}
return
allLines.filter(filterFunc)
.join(' ')
return true
})
return
withoutBlankLinesAndMarkdown
.join(' ')
}
}
}
}
Copiar
Copiado
Copiar
Copiado
function removeDatesInParentheses(text
)
{
function removeDatesInParentheses(text
: string): string
{
return text.replace(/\((?:\([^()]*\)|[^()])*\)/gm, '').replace(/ /g,' ')
return text.replace(/\((?:\([^()]*\)|[^()])*\)/gm, '').replace(/ /g,' ')
}
}
Copiar
Copiado
Copiar
Copiado
function breakContentIntoSentences(content
) {
function breakContentIntoSentences(content
: IC
ontent
) {
c
ontent
.sentences = []
const sentences = sentenceBoundaryDetection.sentences(content.sourceContentSanitized)
const sentences = sentenceBoundaryDetection.sentences(content.sourceContentSanitized)
Copiar
Copiado
Copiar
Copiado
sentences.forEach((sentence) => {
content.sentences = sentences.map((text: string) => ({
content.sentences.push({
text,
text: sentence,
keywords: [],
keywords: [],
images: []
images: []
})
)
})
}
)
}
}
}
}
module.exports = robot
module.exports = robot
Diferenças salvas
Texto original
Abrir arquivo
const algorithmia = require('algorithmia') const algorithmiaApiKey = require('../credentials/algorithmia.json').apiKey const sentenceBoundaryDetection = require('sbd') async function robot(content) { await fetchContentFromWikipedia(content) sanitizeContent(content) breakContentIntoSentences(content) async function fetchContentFromWikipedia(content) { const algorithmiaAuthenticated = algorithmia(algorithmiaApiKey) const wikipediaAlgorithm = algorithmiaAuthenticated.algo('web/WikipediaParser/0.1.2') const wikipediaResponde = await wikipediaAlgorithm.pipe(content.searchTerm) const wikipediaContent = wikipediaResponde.get() content.sourceContentOriginal = wikipediaContent.content } function sanitizeContent(content) { const withoutBlankLinesAndMarkdown = removeBlankLinesAndMarkdown(content.sourceContentOriginal) const withoutDatesInParentheses = removeDatesInParentheses(withoutBlankLinesAndMarkdown) content.sourceContentSanitized = withoutDatesInParentheses function removeBlankLinesAndMarkdown(text) { const allLines = text.split('\n') const withoutBlankLinesAndMarkdown = allLines.filter((line) => { if (line.trim().length === 0 || line.trim().startsWith('=')) { return false } return true }) return withoutBlankLinesAndMarkdown.join(' ') } } function removeDatesInParentheses(text) { return text.replace(/\((?:\([^()]*\)|[^()])*\)/gm, '').replace(/ /g,' ') } function breakContentIntoSentences(content) { content.sentences = [] const sentences = sentenceBoundaryDetection.sentences(content.sourceContentSanitized) sentences.forEach((sentence) => { content.sentences.push({ text: sentence, keywords: [], images: [] }) }) } } module.exports = robot
Texto alterado
Abrir arquivo
import algorithmia from 'algorithmia'; const algorithmiaApiKey = require('../credentials/algorithmia.json').apiKey import sentenceBoundaryDetection from 'sbd'; import { IContent } from './robots.api'; async function robot(content: IContent) { await fetchContentFromWikipedia(content) sanitizeContent(content) breakContentIntoSentences(content) async function fetchContentFromWikipedia(content: IContent) { const algorithmiaAuthenticated = algorithmia(algorithmiaApiKey) const wikipediaAlgorithm = algorithmiaAuthenticated.algo('web/WikipediaParser/0.1.2') const wikipediaResponde = await wikipediaAlgorithm.pipe(content.searchTerm) const { wikipediaContent } = wikipediaResponde.get() content.sourceContentOriginal = wikipediaContent } function sanitizeContent(content: IContent) { const withoutBlankLinesAndMarkdown = removeBlankLinesAndMarkdown(content.sourceContentOriginal) const withoutDatesInParentheses = removeDatesInParentheses(withoutBlankLinesAndMarkdown) content.sourceContentSanitized = withoutDatesInParentheses function removeBlankLinesAndMarkdown(text: string): string { const allLines = text.split('\n') const filterFunc = (line: string) => !(line.trim().length === 0 || line.trim().startsWith('=')) return allLines.filter(filterFunc).join(' ') } } function removeDatesInParentheses(text: string): string { return text.replace(/\((?:\([^()]*\)|[^()])*\)/gm, '').replace(/ /g,' ') } function breakContentIntoSentences(content: IContent) { const sentences = sentenceBoundaryDetection.sentences(content.sourceContentSanitized) content.sentences = sentences.map((text: string) => ({ text, keywords: [], images: [] })) } } module.exports = robot
Encontrar Diferença