મફત ટેક્સ્ટ ડિફ

ટેક્સ્ટના બે બ્લોકને સરખાવો અને બરાબર જુઓ શું બદલાયું. ઉમેરાયેલી, દૂર થયેલી અને અપરિવર્તિત લાઇનો સાથે લાઇન-બાય-લાઇન ડિફ.

એક વાર લોડ થયા પછી ઑફલાઇન કામ કરે છે
સંદર્ભ:
+3 ઉમેરાયું−2 કાઢી નાખ્યું2 અપરિવર્તિત
ડિફ
+The quick brown fox leaps over the lazy dog.
−The quick brown fox jumps over the lazy dog.
Pack my box with five dozen liquor jugs.
+How amazingly quick daft zebras jump!
−How vexingly quick daft zebras jump!
The five boxing wizards jump quickly.
+Now is the time for all good men.

આ કેવી રીતે કાર્ય કરે છે

Text Diff આ ટૂલમાં જ સીધા implement કરેલા હાથે લખેલા Longest Common Subsequence (LCS) algorithm વાપરે છે — કોઈ બાહ્ય diff library નહીં. બધું બ્રાઉઝરમાં ચાલે છે; તમારો text ક્યારેય કોઈ સર્વર પર મોકલાતો નથી.

  1. 1
    Text lines માં split થાય છે
    દરેક textarea નું content newline characters પર lines ના array માં split થાય છે. Comparison પહેલા એ arrays ની કૉપી પર ઓપ્શનલ normalisation (lowercasing, whitespace collapsing) લાગુ થાય છે, જ્યારે originals display માટે રાખવામાં આવે છે.
  2. 2
    LCS table Uint32Array માં ગણવામાં આવે છે
    એક bottom-up dynamic-programming table typed Uint32Array માં બનેલું છે — time અને memory બંનેમાં O(m×n). જે inputs ના combined cell count 4 million (લગભગ 16 MB) કરતાં વધુ થાય તેમના માટે, algorithm આપોઆપ coarser block diff પર fall back કરે છે જેથી page પ્રતિભાવશીલ રહે.
  3. 3
    બદલાયેલી lines પર Word-level highlights
    જ્યારે deleted line તરત inserted line પછી આવે, ત્યારે એ pair ના tokenized words (whitespace પર split) પર બીજો LCS pass ચાલે છે. આ line ની અંદર બરાબર કયા words બદલાયા તે બતાવતા inline highlighted segments બનાવે છે, ફક્ત કઈ lines બદલાઈ તે નહીં.
  4. 4
    Context collapsing સાથે Unified-diff view
    Ops list +/− prefixes અને colour coding સાથે unified diff તરીકે render થાય છે. Configurable context window (ડિફૉલ્ટ: 3 lines) ની બહારની unchanged lines ellipsis પાછળ collapse થાય છે. પૂરું પરિણામ ક્લિપબોર્ડમાં કૉપી કરી શકાય છે કે plain-text .txt ફાઇલ તરીકે ડાઉનલોડ કરી શકાય છે.

સંબંધિત સાધનો

વારંવાર પૂછાતા પ્રશ્નો