export class Cti { private _url: string; private _reject_reason: string; private _title: string; private _companies: CtiOneCompany[] = []; private _categories: CtiOneCategory[] = []; constructor(obj?) { if (obj) { if (obj.url) { this._url = obj.url; } if (obj.reject_reason) { this._reject_reason = obj.reject_reason; } if (obj.title) { this._title = obj.title; } if (obj.companies) { for (const i in obj.companies) { this._companies.push(new CtiOneCompany(obj.companies[i])); } // this._companies = obj.companies; } if (obj.categories) { for (const i in obj.categories) { this._categories.push(new CtiOneCategory(obj.categories[i])); } // this._categories = obj.categories; } } } get url(): string { return this._url; } set url(value: string) { this._url = value; } get reject_reason(): string { return this._reject_reason; } set reject_reason(value: string) { this._reject_reason = value; } get title(): string { return this._title; } set title(value: string) { this._title = value; } get companies(): CtiOneCompany[] { return this._companies; } set companies(value: CtiOneCompany[]) { this._companies = value; } get categories(): CtiOneCategory[] { return this._categories; } set categories(value: CtiOneCategory[]) { this._categories = value; } public toJSON() { return { url: this.url, title: this.title, companies: this.companies, categories: this.categories, }; } } export class CtiOneCompany { name = ''; rank = 0; probability = 1; dozi_id = 0; constructor(obj?) { if (obj) { if (obj.name) { this.name = obj.name; } if (obj.rank) { this.rank = obj.rank; } if (obj.probability) { this.probability = obj.probability; } if (obj.dozi_id) { this.dozi_id = obj.dozi_id; } if (obj.company_name) { this.name = obj.company_name; } if (obj.company_rank) { this.rank = obj.company_rank; } if (obj.company_probability) { this.probability = obj.company_probability; } if (obj.dozi_company_id) { this.dozi_id = obj.dozi_company_id; } } } } export class CtiOneCategory { name = ''; rank = 0; probability = 1; constructor(obj?) { if (obj) { if (obj.name) { this.name = obj.name; } if (obj.rank) { this.rank = obj.rank; } if (obj.probability) { this.probability = obj.probability; } if (obj.category_name) { this.name = obj.category_name; } if (obj.category_rank) { this.rank = obj.category_rank; } if (obj.category_probability) { this.probability = obj.category_probability; } } } } export class CtiNer { private _id: string; private _url: string; private _title: string; private _companies: OneCompanyNer[] = []; private _categories: OneCategoryNer[] = []; constructor(obj?) { if (obj) { if (obj.id) { this._id = obj.id; } if (obj.url) { this._url = obj.url; } if (obj.title) { this._title = obj.title; } if (obj.companies) { for (const i in obj.companies) { this._companies.push(new OneCompanyNer(obj.companies[i])); } // this._companies = obj.companies; } if (obj.categories) { for (const i in obj.categories) { this._categories.push(new OneCategoryNer(obj.categories[i])); } // this._categories = obj.categories; } } } get id(): string { return this._id; } set id(value: string) { this._id = value; } get url(): string { return this._url; } set url(value: string) { this._url = value; } get title(): string { return this._title; } set title(value: string) { this._title = value; } get companies(): OneCompanyNer[] { return this._companies; } set companies(value: OneCompanyNer[]) { this._companies = value; } get categories(): OneCategoryNer[] { return this._categories; } set categories(value: OneCategoryNer[]) { this._categories = value; } public toJSON() { return { id: this.id, url: this.url, title: this.title, companies: this.companies, categories: this.categories, }; } public toNerEntities(type = 1) { return { relationOptions: [], entities: { companies: this.companies, categories: this.categories, } }; } } export class OneCompanyNer { company_name = ''; company_rank = 0; // company_probability = 1; company_dozi_id = 0; constructor(obj?) { if (obj) { if (obj.name) { this.company_name = obj.name; } if (obj.rank) { this.company_rank = obj.rank; } // if (obj.probability) { // this.company_probability = obj.probability; // } if (obj.dozi_id) { this.company_dozi_id = obj.dozi_id; } if (obj.company_name) { this.company_name = obj.company_name; } if (obj.company_rank) { this.company_rank = obj.company_rank; } // if (obj.company_probability) { // this.company_probability = obj.company_probability; // } if (obj.dozi_company_id) { this.company_dozi_id = obj.dozi_company_id; } } } } export class OneCategoryNer { category_name = ''; category_rank = 0; // category_probability = 1; constructor(obj?) { if (obj) { if (obj.name) { this.category_name = obj.name; } if (obj.rank) { this.category_rank = obj.rank; } // if (obj.probability) { // this.category_probability = obj.probability; // } if (obj.category_name) { this.category_name = obj.category_name; } if (obj.category_rank) { this.category_rank = obj.category_rank; } // if (obj.category_probability) { // this.category_probability = obj.category_probability; // } } } } export const CtiCategories = [ 'General - Press Release', 'Products', 'People', 'General - News Coverage', 'Funding', 'Financial News', 'Mergers & Acquisitions', 'Events', // 'Not an article / corrupt' ];