diff options
author | flywind <43030857+xflywind@users.noreply.github.com> | 2021-02-19 00:47:21 -0600 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-02-18 22:47:21 -0800 |
commit | 9450bf6c08cda9b368a1b3276b570dc6ce039193 (patch) | |
tree | 3a3705ba71ea5261ae08d4819060fc1f23659481 /lib/experimental | |
parent | 35ded020748641379f68adf68c23d1f0aa167c2a (diff) | |
download | Nim-9450bf6c08cda9b368a1b3276b570dc6ce039193.tar.gz |
use single backtick (#17100)
Diffstat (limited to 'lib/experimental')
-rw-r--r-- | lib/experimental/diff.nim | 52 |
1 files changed, 26 insertions, 26 deletions
diff --git a/lib/experimental/diff.nim b/lib/experimental/diff.nim index 9a92aba72..1db891440 100644 --- a/lib/experimental/diff.nim +++ b/lib/experimental/diff.nim @@ -10,14 +10,14 @@ ## This module implements an algorithm to compute the ## `diff`:idx: between two sequences of lines. ## -## A basic example of ``diffInt`` on 2 arrays of integers: +## A basic example of `diffInt` on 2 arrays of integers: ## ## .. code::nim ## ## import experimental/diff ## echo diffInt([0, 1, 2, 3, 4, 5, 6, 7, 8], [-1, 1, 2, 3, 4, 5, 666, 7, 42]) ## -## Another short example of ``diffText`` to diff strings: +## Another short example of `diffText` to diff strings: ## ## .. code::nim ## @@ -59,7 +59,7 @@ type Smsrd = object x, y: int -# template to avoid a seq copy. Required until ``sink`` parameters are ready. +# template to avoid a seq copy. Required until `sink` parameters are ready. template newDiffData(initData: seq[int]; L: int): DiffData = DiffData( data: initData, @@ -71,9 +71,9 @@ proc len(d: DiffData): int {.inline.} = d.data.len proc diffCodes(aText: string; h: var Table[string, int]): DiffData = ## This function converts all textlines of the text into unique numbers for every unique textline ## so further work can work only with simple numbers. - ## ``aText`` the input text - ## ``h`` This extern initialized hashtable is used for storing all ever used textlines. - ## ``trimSpace`` ignore leading and trailing space characters + ## `aText` the input text + ## `h` This extern initialized hashtable is used for storing all ever used textlines. + ## `trimSpace` ignore leading and trailing space characters ## Returns a array of integers. var lastUsedCode = h.len result.data = newSeq[int]() @@ -108,14 +108,14 @@ proc optimize(data: var DiffData) = proc sms(dataA: var DiffData; lowerA, upperA: int; dataB: DiffData; lowerB, upperB: int; downVector, upVector: var openArray[int]): Smsrd = ## This is the algorithm to find the Shortest Middle Snake (sms). - ## ``dataA`` sequence A - ## ``lowerA`` lower bound of the actual range in dataA - ## ``upperA`` upper bound of the actual range in dataA (exclusive) - ## ``dataB`` sequence B - ## ``lowerB`` lower bound of the actual range in dataB - ## ``upperB`` upper bound of the actual range in dataB (exclusive) - ## ``downVector`` a vector for the (0,0) to (x,y) search. Passed as a parameter for speed reasons. - ## ``upVector`` a vector for the (u,v) to (N,M) search. Passed as a parameter for speed reasons. + ## `dataA` sequence A + ## `lowerA` lower bound of the actual range in dataA + ## `upperA` upper bound of the actual range in dataA (exclusive) + ## `dataB` sequence B + ## `lowerB` lower bound of the actual range in dataB + ## `upperB` upper bound of the actual range in dataB (exclusive) + ## `downVector` a vector for the (0,0) to (x,y) search. Passed as a parameter for speed reasons. + ## `upVector` a vector for the (u,v) to (N,M) search. Passed as a parameter for speed reasons. ## Returns a MiddleSnakeData record containing x,y and u,v. let max = dataA.len + dataB.len + 1 @@ -195,14 +195,14 @@ proc lcs(dataA: var DiffData; lowerA, upperA: int; dataB: var DiffData; lowerB, ## algorithm. ## The published algorithm passes recursively parts of the A and B sequences. ## To avoid copying these arrays the lower and upper bounds are passed while the sequences stay constant. - ## ``dataA`` sequence A - ## ``lowerA`` lower bound of the actual range in dataA - ## ``upperA`` upper bound of the actual range in dataA (exclusive) - ## ``dataB`` sequence B - ## ``lowerB`` lower bound of the actual range in dataB - ## ``upperB`` upper bound of the actual range in dataB (exclusive) - ## ``downVector`` a vector for the (0,0) to (x,y) search. Passed as a parameter for speed reasons. - ## ``upVector`` a vector for the (u,v) to (N,M) search. Passed as a parameter for speed reasons. + ## `dataA` sequence A + ## `lowerA` lower bound of the actual range in dataA + ## `upperA` upper bound of the actual range in dataA (exclusive) + ## `dataB` sequence B + ## `lowerB` lower bound of the actual range in dataB + ## `upperB` upper bound of the actual range in dataB (exclusive) + ## `downVector` a vector for the (0,0) to (x,y) search. Passed as a parameter for speed reasons. + ## `upVector` a vector for the (u,v) to (N,M) search. Passed as a parameter for speed reasons. # make mutable copy: var lowerA = lowerA @@ -275,9 +275,9 @@ proc createDiffs(dataA, dataB: DiffData): seq[Item] = proc diffInt*(arrayA, arrayB: openArray[int]): seq[Item] = ## Find the difference in 2 arrays of integers. ## - ## ``arrayA`` A-version of the numbers (usually the old one) + ## `arrayA` A-version of the numbers (usually the old one) ## - ## ``arrayB`` B-version of the numbers (usually the new one) + ## `arrayB` B-version of the numbers (usually the new one) ## ## Returns a sequence of Items that describe the differences. @@ -304,9 +304,9 @@ proc diffText*(textA, textB: string): seq[Item] = ## textlines into a common hashtable so i can find duplicates in there, and generating a ## new number each time a new textline is inserted. ## - ## ``textA`` A-version of the text (usually the old one) + ## `textA` A-version of the text (usually the old one) ## - ## ``textB`` B-version of the text (usually the new one) + ## `textB` B-version of the text (usually the new one) ## ## Returns a seq of Items that describe the differences. |