-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathclassifyRows.js
More file actions
27 lines (24 loc) · 835 Bytes
/
classifyRows.js
File metadata and controls
27 lines (24 loc) · 835 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
const CHAPTER = 'CHAPTER';
module.exports.CHAPTER = CHAPTER;
const PART= 'PART';
module.exports.PART = PART;
module.exports.classify = (row)=>{
let i=0;
let firstColumn;
do{
firstColumn = row['column'][i]["text"];
i++;
}while(firstColumn === "");
const rowParams={
fontName: (firstColumn !== "" && firstColumn["@fontName"]?firstColumn["@fontName"]:null),
fontSize: (firstColumn !== "" && firstColumn["@fontSize"]?firstColumn["@fontSize"]:null),
fontStyle: (firstColumn !== "" && firstColumn["@fontStyle"]?firstColumn["@fontStyle"]:null)
};
//Chapter & Part
if (rowParams.fontStyle==="Bold"){
if (firstColumn["#text"].includes('קרפ')) return(CHAPTER);
if (firstColumn["#text"].includes('קלח')) return(PART);
}else{
}
return;
};