Dim Title, Content, Keyword, Lengths, i, Titlex
Title = "把教学计划交给院长去查看"
Content = "将下月的教学计划和相应的交交资料给院长查看将下月的教学计划和相应的交交资料给院长查看"
Titlex = "把教学计划交给院长去查看"
Set Keyword = Server.CreateObject("Scripting.Dictionary")
Set Lengths = Server.CreateObject("Scripting.Dictionary")
i = 0
while i < Len(Title)
Dim tmpCon, tmpKey, tmpLen
i = i + 1
tmpKey = Mid(Title,i,1)
tmpCon = Replace(Content,tmpKey,"")
tmpLen = (Len(Content) - Len(tmpCon)) / Len(tmpKey)
If CStr(tmpLen) = CStr(Lengths(Lengths.Count - 1)) and Keyword.Count > 0 Then
Keyword(Keyword.Count - 1) = Keyword(Keyword.Count - 1) & tmpKey
Else
If Keyword.Count > 0 Then
Lengths(Lengths.Count - 1) = tmpLen / Len(Content)
End If
Lengths.Add Lengths.Count, tmpLen
Keyword.Add Keyword.Count, tmpKey
End If
wend
for i = 0 to Keyword.Count - 1
Response.Write Keyword(i) & ","
next
Response.Write "<br />"
Dim e
for i = 0 to Keyword.Count - 1
tmpKey = Keyword(i)
tmpCon = Replace(Titlex,tmpKey,"")
tmpLen = (Len(Titlex) - Len(tmpCon)) / Len(tmpKey)
e = e + tmpLen / Len(Titlex) * Lengths(i)
next
Response.Write e * 100