mirror of
https://github.com/Kaehvaman/OAIP.git
synced 2025-01-19 09:09:12 +04:00
227 lines
6.1 KiB
C
227 lines
6.1 KiB
C
|
#define _CRT_SECURE_NO_WARNINGS
|
|||
|
#include <string.h>
|
|||
|
#include <time.h>
|
|||
|
#include <stdio.h>
|
|||
|
|
|||
|
#include "Dict.h"
|
|||
|
|
|||
|
int getNextDelim(FILE* fp, char token[]);
|
|||
|
int getNextWord(FILE* fp, char token[], int maxLen);
|
|||
|
|
|||
|
int LoadDictionary(char* filename);
|
|||
|
int TextProcessing(char* filenameIn, char* filenameOut);
|
|||
|
|
|||
|
|
|||
|
char filenameDict[] = "c:\\Temp\\FIST2024\\TextMarkup\\dict2.txt";
|
|||
|
//char filenameIn[] = "c:\\Temp\\FIST2024\\TextMarkup\\text1_out.html";
|
|||
|
//char filenameOut[] = "c:\\Temp\\FIST2024\\TextMarkup\\text1_out_out.html";
|
|||
|
//char filenameIn[] = "c:\\Temp\\FIST2024\\TextMarkup\\text1.txt";
|
|||
|
//char filenameOut[] = "c:\\Temp\\FIST2024\\TextMarkup\\text1_out.html";
|
|||
|
|
|||
|
//char filenameIn[] = "c:\\Temp\\FIST2024\\TextMarkup\\Alice.txt";
|
|||
|
//char filenameOut[] = "c:\\Temp\\FIST2024\\TextMarkup\\Alice_out.html";
|
|||
|
char filenameIn[] = "c:\\Temp\\FIST2024\\TextMarkup\\Tolkien.txt";
|
|||
|
char filenameOut[] = "c:\\Temp\\FIST2024\\TextMarkup\\Tolkien_out.html";
|
|||
|
|
|||
|
|
|||
|
void main() {
|
|||
|
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
printf("HTML file %s\nis created from text file %s\nwith highlighting words from %s\ndictionary\n\n\n",
|
|||
|
filenameOut, filenameIn, filenameDict);
|
|||
|
|
|||
|
// t0 - <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> <20> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> main()
|
|||
|
long t0 = clock();
|
|||
|
printf("t0 = %.3f sec \n", t0 / (float)CLOCKS_PER_SEC);
|
|||
|
|
|||
|
LoadDictionary(filenameDict);
|
|||
|
|
|||
|
// t1 - <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
int t1 = clock();
|
|||
|
printf("t1 = %.3f sec \n", t1 / (float)CLOCKS_PER_SEC);
|
|||
|
|
|||
|
TextProcessing(filenameIn, filenameOut);
|
|||
|
|
|||
|
// t2 - <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
long t2 = clock();
|
|||
|
printf("t2 = %.3f sec \n", t2 / (float)CLOCKS_PER_SEC);
|
|||
|
|
|||
|
Destroy();
|
|||
|
|
|||
|
// t3 - <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
long t3 = clock();
|
|||
|
|
|||
|
printf("t3 = %.3f sec \n", t3 / (float)CLOCKS_PER_SEC);
|
|||
|
printf("t1 - t0 = %.3f sec (Run time of dictionary loading)\n", (t1 - t0) / (float)CLOCKS_PER_SEC);
|
|||
|
printf("t2 - t1 = %.3f sec (Run time of HTML generating)\n", (t2 - t1) / (float)CLOCKS_PER_SEC);
|
|||
|
printf("t3 - t2 = %.3f sec (Run time of dictionary destroying )\n", (t3 - t1) / (float)CLOCKS_PER_SEC);
|
|||
|
}
|
|||
|
|
|||
|
|
|||
|
int LoadDictionary(char* filename) {
|
|||
|
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>
|
|||
|
FILE* fin = fopen(filename, "rt");
|
|||
|
if (fin == NULL) {
|
|||
|
// <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> - <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> <20><><EFBFBD><EFBFBD>
|
|||
|
printf("File %s doesn't opened!\n", filename);
|
|||
|
return 0;
|
|||
|
}
|
|||
|
|
|||
|
Create();
|
|||
|
char token[MAX_LEN_WORD];
|
|||
|
|
|||
|
// <20><><EFBFBD><EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
while (!feof(fin)) {
|
|||
|
// <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> - <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD>
|
|||
|
while (getNextDelim(fin, token)) {
|
|||
|
}
|
|||
|
// <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> - <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD>
|
|||
|
if (getNextWord(fin, token, MAX_LEN_WORD)) {
|
|||
|
Insert(token);
|
|||
|
}
|
|||
|
}
|
|||
|
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
fclose(fin);
|
|||
|
return 1;
|
|||
|
}
|
|||
|
|
|||
|
|
|||
|
|
|||
|
int TextProcessing(char* filenameIn, char* filenameOut) {
|
|||
|
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
FILE* fin = fopen(filenameIn, "rt");
|
|||
|
if (fin == NULL) {
|
|||
|
// <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> - <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> <20><><EFBFBD><EFBFBD>
|
|||
|
printf("File %s doesn't opened!\n", filenameIn);
|
|||
|
return 0;
|
|||
|
}
|
|||
|
|
|||
|
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
FILE* fout = fopen(filenameOut, "wt");
|
|||
|
if (fout == NULL) {
|
|||
|
// <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> - <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> <20><><EFBFBD><EFBFBD>
|
|||
|
printf("File %s doesn't opened!\n", filenameOut);
|
|||
|
// <20> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>
|
|||
|
fclose(fin);
|
|||
|
return 0;
|
|||
|
}
|
|||
|
|
|||
|
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> HTML <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
fprintf(fout, "<!DOCTYPE html>");
|
|||
|
fprintf(fout, "<html>");
|
|||
|
fprintf(fout, "<head>");
|
|||
|
fprintf(fout, "<meta http - equiv = \"Content-Type\" content = \"text/html; charset=utf-8\" />");
|
|||
|
fprintf(fout, "<title>HTML Document</title>");
|
|||
|
fprintf(fout, "</head>");
|
|||
|
fprintf(fout, "<body>");
|
|||
|
char token[MAX_LEN_WORD];
|
|||
|
|
|||
|
// <20><><EFBFBD><EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
while (!feof(fin)) {
|
|||
|
// <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> - <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD>
|
|||
|
while (getNextDelim(fin, token)) {
|
|||
|
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
if (strcmp(token, "<") == 0) {
|
|||
|
fprintf(fout, "<");
|
|||
|
}
|
|||
|
else if (strcmp(token, ">") == 0) {
|
|||
|
fprintf(fout, ">");
|
|||
|
}
|
|||
|
else {
|
|||
|
if (strcmp(token, "\n") == 0) {
|
|||
|
fprintf(fout, "<br>");
|
|||
|
}
|
|||
|
fprintf(fout, "%s", token);
|
|||
|
}
|
|||
|
}
|
|||
|
// <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> - <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD>
|
|||
|
if (getNextWord(fin, token, MAX_LEN_WORD)) {
|
|||
|
// <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20> <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD>
|
|||
|
if (Member(token)) {
|
|||
|
fprintf(fout, "<b>%s</b>", token);
|
|||
|
}
|
|||
|
else {
|
|||
|
fprintf(fout, "%s", token);
|
|||
|
}
|
|||
|
}
|
|||
|
}
|
|||
|
|
|||
|
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20> HTML <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> HTML
|
|||
|
fprintf(fout, "</body>");
|
|||
|
fprintf(fout, "</html>");
|
|||
|
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
fclose(fin);
|
|||
|
fclose(fout);
|
|||
|
|
|||
|
return 1;
|
|||
|
}
|
|||
|
|
|||
|
int isalpha_my(unsigned char ch);
|
|||
|
|
|||
|
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> 1 - <20><><EFBFBD><EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>.
|
|||
|
// <20> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20> token <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
// <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>.
|
|||
|
// <20><><EFBFBD><EFBFBD> <20> <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> - <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> 0.
|
|||
|
// <20> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> token <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>.
|
|||
|
int getNextDelim(FILE* fp, char token[])
|
|||
|
{
|
|||
|
int ch = getc(fp);
|
|||
|
if (ch == EOF) {
|
|||
|
return 0;
|
|||
|
}
|
|||
|
if (isalpha_my((unsigned char)ch)) {
|
|||
|
ungetc(ch, fp);
|
|||
|
return 0;
|
|||
|
}
|
|||
|
token[0] = (unsigned char)ch;
|
|||
|
token[1] = '\0';
|
|||
|
return 1;
|
|||
|
}
|
|||
|
|
|||
|
|
|||
|
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> 1 - <20><><EFBFBD><EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>.
|
|||
|
// <20> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20> token <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
// <20><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>. <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> maxLen <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>.
|
|||
|
// <20><><EFBFBD><EFBFBD> <20> <20><><EFBFBD><EFBFBD><EFBFBD> <20><> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> - <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> 0.
|
|||
|
// <20> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> token <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>.
|
|||
|
int getNextWord(FILE* fp, char token[], int maxLen)
|
|||
|
{
|
|||
|
int i = 0;
|
|||
|
int ch;
|
|||
|
while (((ch = getc(fp)) != EOF) && (i < maxLen - 1)) {
|
|||
|
if (!isalpha_my((unsigned char)(ch))) {
|
|||
|
break;
|
|||
|
}
|
|||
|
token[i++] = ch;
|
|||
|
}
|
|||
|
ungetc(ch, fp);
|
|||
|
token[i] = '\0';
|
|||
|
if (i == 0)
|
|||
|
return 0;
|
|||
|
return 1;
|
|||
|
}
|
|||
|
|
|||
|
|
|||
|
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> 0 - <20><><EFBFBD><EFBFBD> ch - <20><> <20><><EFBFBD><EFBFBD><EFBFBD>.
|
|||
|
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> 1 - <20><><EFBFBD><EFBFBD> ch - <20><><EFBFBD><EFBFBD><EFBFBD>.
|
|||
|
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> (<28> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> < 128)
|
|||
|
// <20> <20><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> ANSI
|
|||
|
int isalpha_my(unsigned char ch) {
|
|||
|
if (isalpha(ch))
|
|||
|
return 1;
|
|||
|
|
|||
|
// ANSI <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>!!!
|
|||
|
if (ch >= 192 && ch <= 223)
|
|||
|
return 1;
|
|||
|
if (ch >= 224 && ch <= 255)
|
|||
|
return 1;
|
|||
|
|
|||
|
/*
|
|||
|
if (ch >= '<EFBFBD>' && ch <= '<EFBFBD>') return 1;
|
|||
|
if (ch >= '<EFBFBD>' && ch <= '<EFBFBD>') return 1;
|
|||
|
if (ch >= '<EFBFBD>' && ch <= '<EFBFBD>')return 1;
|
|||
|
if (ch == '<EFBFBD>' ) return 1;
|
|||
|
if (ch == '<EFBFBD>') return 1;*/
|
|||
|
|
|||
|
return 0;
|
|||
|
}
|