Diff
checker
テキスト
テキスト
画像
ドキュメント
Excel
フォルダ
Legal
Enterprise
デスクトップ
料金
ログイン
Diffchecker デスクトップのダウンロード
テキスト比較
2 つのテキスト ファイルの違いを見つける
ツール
履歴
ライブエディター
未変更行を折りたたむ
折り返しなし
レイアウト
分割
統合
比較精度
スマート
単語
文字
シンタックスハイライト
構文を選択
無視
テキスト変換
最初の差分へ移動
入力を編集
Diffchecker Desktop
Diffcheckerを実行する最も安全な方法。Diffchecker Desktopアプリを入手:あなたの差分はコンピューターから出ることはありません!
Desktopを入手
Untitled diff
作成日
7 年前
差分は期限切れになりません
クリア
エクスポート
共有
説明
35 削除
行
合計
削除
文字
合計
削除
この機能を引き続き使用するには、アップグレードしてください
Diff
checker
Pro
価格を見る
60 行
すべてコピー
25 追加
行
合計
追加
文字
合計
追加
この機能を引き続き使用するには、アップグレードしてください
Diff
checker
Pro
価格を見る
52 行
すべてコピー
コピー
コピー済み
コピー
コピー済み
const
algorithmia
= require(
'algorithmia'
)
import
algorithmia
from
'algorithmia'
;
const algorithmiaApiKey = require('../credentials/algorithmia.json').apiKey
const algorithmiaApiKey = require('../credentials/algorithmia.json').apiKey
コピー
コピー済み
コピー
コピー済み
const
sentenceBoundaryDetection
= require(
'sbd'
)
import
sentenceBoundaryDetection
from
'sbd'
;
import { IContent } from './robots.api';
コピー
コピー済み
コピー
コピー済み
async function robot(content
) {
async function robot(content
: IContent
) {
await fetchContentFromWikipedia(content)
await fetchContentFromWikipedia(content)
sanitizeContent(content)
sanitizeContent(content)
breakContentIntoSentences(content)
breakContentIntoSentences(content)
コピー
コピー済み
コピー
コピー済み
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)
コピー
コピー済み
コピー
コピー済み
const
wikipediaContent
= wikipediaResponde.get()
const
{
wikipediaContent
}
= wikipediaResponde.get()
content.sourceContentOriginal = wikipediaContent
.content
content.sourceContentOriginal = wikipediaContent
}
}
コピー
コピー済み
コピー
コピー済み
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
コピー
コピー済み
コピー
コピー済み
function removeBlankLinesAndMarkdown(text
)
{
function removeBlankLinesAndMarkdown(text
: string): string
{
const allLines = text.split('\n')
const allLines = text.split('\n')
コピー
コピー済み
コピー
コピー済み
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(' ')
}
}
}
}
コピー
コピー済み
コピー
コピー済み
function removeDatesInParentheses(text
)
{
function removeDatesInParentheses(text
: string): string
{
return text.replace(/\((?:\([^()]*\)|[^()])*\)/gm, '').replace(/ /g,' ')
return text.replace(/\((?:\([^()]*\)|[^()])*\)/gm, '').replace(/ /g,' ')
}
}
コピー
コピー済み
コピー
コピー済み
function breakContentIntoSentences(content
) {
function breakContentIntoSentences(content
: IC
ontent
) {
c
ontent
.sentences = []
const sentences = sentenceBoundaryDetection.sentences(content.sourceContentSanitized)
const sentences = sentenceBoundaryDetection.sentences(content.sourceContentSanitized)
コピー
コピー済み
コピー
コピー済み
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
保存された差分
原文
ファイルを開く
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
変更されたテキスト
ファイルを開く
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
違いを見つける