Skip to content

Instantly share code, notes, and snippets.

View myfreess's full-sized avatar

NSlash951 myfreess

View GitHub Profile

SAT Solver从会用到会写

实现一个能用的Gumtree Diff

tree diff在传统上分成两步:

  • 在新旧两棵树里相似度比较高的子树之间建立映射/节点对(这些映射有两个约束:给定节点只能属于一个映射,并且映射涉及两个具有相同标签的节点。)
  • 在这个配对基础上生成编辑脚本

第二步很早就已经有了非常成熟的算法(1996, Change Detection in Hierarchically Structured Information), gumtree专注于第一步,提出了一种新的子树配对策略。

Gumtree Diff的基本思路

Start-Process powershell -Verb runAs # 提升为管理员权限
chcp 65001 # 放在Document/WindowsPowerShell/Microsoft.PowerShell_profile里面