Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
//
#include "stdafx.h"
#include <iostream>
using namespace std;
#include <stdio.h>
#include <stdlib.h>
typedef struct term_s {
int start; // start position
int end; // end position
int level; // priority
term_s *next; // pointer to next term
} Term;
typedef struct term_list_s
{
Term *first;
Term *last;
int count;
} TermList;
TermList *CreateTermList(){
TermList *p = (TermList *)malloc(sizeof(TermList));
p->first = p->last = 0;
p->count = 0;
return p;
}
Term* CreateTerm(int level = 0, int start = 0, int end = -1 )
{
Term *p = (Term *)malloc(sizeof(Term));
p->next = 0;
p->start = start; // p la con tro nen muon truy cap vao thanh phan trong no th
dng du ->
p->end = end;
p->level = level;
return p;
}