Research Article

An Information Retrieval Algorithm for Accounting Internal Audit Using Multi-Pattern Similarity Matching

Algorithm 1

Complete hash trie matching algorithm.
typedef struct Head_Hash_Table{
  struch Trie_Node ∗head;
}Head_Index[CI\ODE_LEN][CODE_LEN];
typedf struct Trie_Node{
  struch Trie_Node ∗next[CODE_LEN];
}Trie_Node;
for(i = 0; i < key_sum; i++{
  if(kw[i][0]>128){
    len = strlen(kw[i]);
    if(!head_index[kw[i]][0][kw[i][1]].head){
      p_1 = malloc(sizeof(struct Trie_Node));
      head_index[kw[i]][0][kw[i][1]].head = p_1; }
    else
      p_1 = head_index[kw[i]][0][kw[i][1]].head;
    for(k = 2; k < len; k++){
      if(k< len-1){
      if(!p_1⟶next[kw[i][k]]){
        p_2 = mallow(sizeof(struct Trie_Node));
        p_1⟶next[kw[i][k]] = p_1 = p_2; }
      else p_1 = p_1⟶next[kw[i][k]]; }}
    else{
}
for(i = o; i < strlen(Text)){
  if(T[i]>128){
   fwd_num = 2;
   p = head_index[T[i]][T[i+1]].head;
   if(p&&p⟶next[T[I+2]]){
    p-p⟶next[T[i+2]]⟶next[T[i+3]];
    m = 4;
    if(End_FLAG = = p)PRINTkw;
    else
      while (NIULL! = p){
        if(End = = P){PRINTkw; break; }
        if(p⟶next[T[i + m]]){p = p⟶next[T[i + m]]⟶next[T[i + m + 1]]; m + 2; }
        else break;
    else{
      fwd_num1; }
    i+ = fwd_num;
}