Skip to content

Commit cb40159

Browse files
added missing parts
1 parent bffd312 commit cb40159

16 files changed

+169
-17
lines changed

python-net/advanced-usage/comparison/accept-or-reject-detected-changes.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,12 @@ with gc.Comparer("source.docx") as comparer:
5656

5757
🔹 Use case: Remove undesired edits from the final deliverable while keeping approved changes.
5858

59+
The result is as follows:
60+
61+
| Accepted changes | Rejected changes |
62+
| :-----------------------------------------------------------------: | :----------------------------------------------------------------: |
63+
| ![](/comparison/python-net/images/accepted-changes.png) | ![](/comparison/python-net/images/rejected-changes.png) |
64+
5965
## Accept or reject changes (streams)
6066

6167
Work entirely with streams and persist the merged result.

python-net/advanced-usage/comparison/accept-or-reject-revisions.md

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,4 +117,13 @@ with RevisionHandler(source_path) as revision_handler:
117117
options.common_handler = RevisionAction.Accept
118118

119119
revision_handler.apply_revision_changes(result_path, options)
120-
```
120+
```
121+
122+
123+
## Result of revision processing
124+
125+
Below are the source and output files based on the code presented earlier.
126+
127+
| Source file | Result file |
128+
| --------------------------------------------- | ---------------------------------------------------- |
129+
| ![](/comparison/net/images/revision-file.png) | ![](/comparison/python-net/images/result-revision-file.png) |

python-net/advanced-usage/comparison/adjusting-comparison-sensitivity.md

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,36 @@ structuredData:
3232

3333
[GroupDocs.Comparison for Python via .NET](https://products.groupdocs.com/comparison/python-net) supports sensitivity levels from 0 (fastest, least detailed) to 100 (slowest, most detailed).
3434

35+
[GroupDocs.Comparison](https://products.groupdocs.com/comparison/net) allows you to adjust comparison sensitivity to achieve the necessary balance between the comparison speed and accuracy. Possible comparison sensitivity values range is from **0** to **100**.
36+
37+
- **Minimal value** (**0**) sets sensitivity to a minimal value provides the fastest comparison speed, but it may produce worst comparison quality. If there is at least one common letter in two compared words then these words are not treated as fully inserted and deleted
38+
- **Value by default** means **75**. Comparison occurs when the percentage of deleted or inserted elements in relation to all elements does not exceed 75%
39+
- **Maximum value** (**100**) provides the best quality, but slowest comparison speed. Comparison occurs at any length of a common sub-sequence of two compared objects
40+
41+
For better understanding about how comparison algorithms work let's suppose we have two strings:
42+
43+
| Strings |
44+
| -------------------------------- |
45+
| ` 1``. It is our equity poetry ` |
46+
| ` 2``. Jack is a glad calf ` |
47+
48+
So, these strings have two common sub-sequences: "**is**" word and 4 space symbols. 
49+
Common sub-sequence is - " **is** " and its length is 4 symbols (there are 2 space symbols in it).
50+
Length of inserted sub-sequence is 13 symbols - **Jackagladcalf**
51+
Removed sub-sequence length is 17 symbols - **Itourequitypoetry\*_
52+
Lets calculate percent of removed and inserted symbols: (17 + 13) / (17 + 13 + 4) * 100 = 88%
53+
54+
*Case 1.* If **SensitivityOfComparison = 80%** comparison of these two strings produces the next result:
55+
**Jack is a glad calfIt is our equity poetry**
56+
57+
Because calculated percent of removed and inserted symbols equals **88%** and it is bigger than value of **SensitivityOfComparison** equals **80%** then this common sub-sequence will be not taken into account.
58+
The first string considered completely removed and the second string considered completely inserted. The same results are produced for any calculated percent less than **83%**.
59+
60+
_Case 2._ If **SensitivityOfComparison = 89%**, comparison of these two strings produces the next result:
61+
**JackIt is aour gladequity calfpoetry**
62+
63+
Common sub-sequence was found, because **89% > 88%**. The same results are produced for any calculated percent bigger than **88%**.
64+
3565
## Adjust overall sensitivity
3666

3767
Increase sensitivity to detect smaller changes or reduce it for faster processing.

python-net/advanced-usage/comparison/compare-bookmarks-in-word.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,4 +48,8 @@ with gc.Comparer("source.docx") as comparer:
4848

4949
🔹 Use case: Validate that critical bookmarked sections (e.g., clauses) remain unchanged.
5050

51+
The result is as follows:
52+
53+
![](/comparison/python-net/images/compared-bookmarks.png)
54+
5155

python-net/advanced-usage/comparison/customize-changes-styles.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,6 @@ structuredData:
3434

3535
To compare two documents with custom change style settings, follow these steps:
3636

37-
🔹 Use case: Enforce brand-compliant highlighting for insertions, deletions, and edits in legal reviews.
38-
3937
1. Instantiate the `Comparer` object with a source path or stream.
4038
2. Call `add()` and provide the target path or stream.
4139
3. Instantiate `CompareOptions` and configure `InsertedItemStyle`, `DeletedItemStyle`, and `ChangedItemStyle`.

python-net/advanced-usage/comparison/disable-image-comparison-in-pdf-documents.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,4 +49,8 @@ with gc.Comparer("source.pdf") as comparer:
4949

5050
🔹 Use case: Speed up PDF comparisons and avoid noise from embedded graphics.
5151

52+
The result is as follows:
53+
54+
![](/comparison/python-net/images/disable-image-comparison-in-pdf-documents.png)
55+
5256

python-net/advanced-usage/comparison/get-changes-coordinates.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,4 +51,8 @@ with gc.Comparer("source.docx") as comparer:
5151

5252
🔹 Use case: Draw bounding boxes over preview images to visualize change locations.
5353

54+
The result is as follows:
55+
56+
![](/comparison/python-net/images/get-changes-coordinates.png)
57+
5458

python-net/advanced-usage/comparison/get-extended-information-on-the-summary-page.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,3 +49,10 @@ with gc.Comparer("source.docx") as comparer:
4949
🔹 Use case: Provide management with detailed metrics beyond the standard summary counts.
5050

5151

52+
The result is as follows:
53+
54+
![](/comparison/python-net/images/how-to-get-extended-information-image.png)
55+
56+
57+
58+

python-net/advanced-usage/comparison/get-list-of-changes.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,10 @@ with gc.Comparer("source.docx") as comparer:
4949

5050
🔹 Use case: Build a custom report UI that lists all differences with pagination info.
5151

52+
The result is as follows:
53+
54+
![](/comparison/python-net/images/get-changes-list.png)
55+
5256
## Get list of changes from stream
5357

5458
Compare from streams and retrieve the changes programmatically.

python-net/advanced-usage/comparison/get-only-summary-page.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,4 +48,8 @@ with gc.Comparer("source.docx") as comparer:
4848

4949
🔹 Use case: Share a concise overview of differences without exposing full document content.
5050

51+
The result is as follows:
52+
53+
![](/comparison/python-net/images/get-only-summary-page.png)
54+
5155

0 commit comments

Comments
 (0)