Mercurial > hg > ng2-query-ismi
view app/normalization.service.ts @ 31:4926885f8a99
selectable result columns. nicer cypher query output.
author | casties |
---|---|
date | Mon, 01 Feb 2016 20:10:55 +0100 |
parents | f7a7014abf5c |
children | 5353b2dffb0f |
line wrap: on
line source
import {Injectable} from 'angular2/core'; import {Http, Headers} from 'angular2/http'; import 'rxjs/Rx'; // import all RxJS operators @Injectable() export class NormalizationService { public openMindBaseUrl = 'https://ismi-dev.mpiwg-berlin.mpg.de/om4-ismi/'; //public openMindBaseUrl = 'http://localhost:18080/ismi-richfaces/'; constructor(private _http: Http) {} fetchArabicTranslitNormalizedString(text: string) { console.debug("fetching arabic translit normalized string: ", text); var headers = new Headers(); headers.append('Accept', 'application/json'); // put headers in options var opts = {'headers': headers}; // make get request asynchronously var url = this.openMindBaseUrl+'jsonInterface?method=normalize_string&type=arabic_translit&text='; url += text; var resp = this._http.get(url, opts) // filter result as JSON .map(res => res.json()); // return Observable return resp; } }