linestr="A,B;B,C;C,A;A,H,HA;B,H;C,H,HC;L,HC;K,H;HA,M,E';B,K;B,M;L,E';HC,B;HA,B;L,B;E',HC";circlestr="A,B,C,K,HA,HC,E'";{lineset,circleset}=StringSplit[StringSplit[#,";"],","]&/@{linestr,circlestr};
circleset=DeleteCases[circleset,Length[#]<4&];findline[pair_]:=Block[{i=1},While[i<=Length[lineset]&&!SubsetQ[lineset[[i]],pair],i++];If[i==Length[lineset]+1,Nothing,Subscript[l,i]]];
angle[a_,b_,c_]:=findline[{a,b}]-findline[{b,c}];isline[pair_]:=AnyTrue[lineset,SubsetQ[#,pair]&];f[{{a_,b_}|{b_,a_},{a_,c_}|{c_,a_}}]:={a,{b,c}};f[_]:=Nothing;
samelinepairs={{}};
While[samelinepairs!={},
assocs=Table[Select[Subsets[circle,{2}],isline],{circle,circleset}];eqns=Flatten@Table[Apply[Equal,(Function[a,2findline[a]-Subscript[l,{i,a[[2]]}]]/@Tuples@{{#[[1,1]]},Union@Flatten[Last/@#]}&)/@GatherBy[f/@Subsets[assocs[[i]],2],First],{1}],{i,Length[assocs]}];
eqns=eqns~Join~
{findline[{"HC","B"}]+findline[{"H","B"}]==findline[{"B","K"}]+findline[{"B","L"}]==findline[{"H","K"}]+findline[{"HC","L"}]==2findline[{"A","B"}],findline[{"HA","B"}]+findline[{"H","B"}]==
findline[{"HA","M"}]+findline[{"H","K"}]==findline[{"B","M"}]+findline[{"B","K"}]==2findline[{"B","C"}]};
rules=Solve[eqns][[1]];
intersectinglinepairs=Select[Subsets[Range[Length[lineset]],{2}],IntersectingQ[lineset[[#[[1]]]],lineset[[#[[2]]]]]&];
samelinepairs=Select[intersectinglinepairs,Function[a,Expand[Subscript[l,a[[1]]]-Subscript[l,a[[2]]]/.rules]==0]];
(*通过rules找到相同的直线,比如l1和l2,其中l1的序号较小,将l1∪l2设为新的l1,并将l2设为空集.在这个过程中,若发现l1是空集,那说明l1已经被合并到别的序号更小的直线l0了,于是就不用把l2合并到l1了,因为已经有规则把l2合并到l0.*)
Block[{updatedlines=Table[{},Length[lineset]]},
lineset=Block[{newlineset=lineset,i=1,l1,l2},
While[i<=Length[samelinepairs],{l1,l2}=samelinepairs[[i]];
If[newlineset[[l1]]!={},
newlineset[[l1]]=updatedlines[[i]]=Union[newlineset[[l1]],lineset[[l2]]]];
newlineset[[l2]]={};i++];DeleteCases[newlineset,{}]];
(*去除已经包含在其它直线里的直线,比如,若lineset中同时有l1和l2且l1!=l2且l1⊂l2,则l1将被去除.这里,l2是由上一步将旧的直线合并得到的.*)
lineset=Select[lineset,Function[l1,NoneTrue[updatedlines,Function[l2,l2!=l1&&SubsetQ[l2,l1]]]]]]];
angle["L","HC","B"]-angle["E'","HC","B"]/.rules

rules/.(Subscript[l, a_?NumberQ]):>Subscript[l,lineset[[a]]]