Skip to content

Latest commit

 

History

History
706 lines (534 loc) · 24.3 KB

ChineseApi.md

File metadata and controls

706 lines (534 loc) · 24.3 KB

NamSorApiV2.ChineseApi

All URIs are relative to https://v2.namsor.com/NamSorAPIv2

Method HTTP request Description
chineseNameCandidates GET /api2/json/chineseNameCandidates/{chineseSurnameLatin}/{chineseGivenNameLatin} Identify Chinese name candidates, based on the romanized name ex. Wang Xiaoming
chineseNameCandidatesBatch POST /api2/json/chineseNameCandidatesBatch Identify Chinese name candidates, based on the romanized name (firstName = chineseGivenName; lastName=chineseSurname), ex. Wang Xiaoming
chineseNameCandidatesGenderBatch POST /api2/json/chineseNameCandidatesGenderBatch Identify Chinese name candidates, based on the romanized name (firstName = chineseGivenName; lastName=chineseSurname) ex. Wang Xiaoming.
chineseNameGenderCandidates GET /api2/json/chineseNameGenderCandidates/{chineseSurnameLatin}/{chineseGivenNameLatin}/{knownGender} Identify Chinese name candidates, based on the romanized name ex. Wang Xiaoming - having a known gender ('male' or 'female')
chineseNameMatch GET /api2/json/chineseNameMatch/{chineseSurnameLatin}/{chineseGivenNameLatin}/{chineseName} Return a score for matching Chinese name ex. 王晓明 with a romanized name ex. Wang Xiaoming
chineseNameMatchBatch POST /api2/json/chineseNameMatchBatch Identify Chinese name candidates, based on the romanized name (firstName = chineseGivenName; lastName=chineseSurname), ex. Wang Xiaoming
genderChineseName GET /api2/json/genderChineseName/{chineseName} Infer the likely gender of a Chinese full name ex. 王晓明
genderChineseNameBatch POST /api2/json/genderChineseNameBatch Infer the likely gender of up to 100 full names ex. 王晓明
genderChineseNamePinyin GET /api2/json/genderChineseNamePinyin/{chineseSurnameLatin}/{chineseGivenNameLatin} Infer the likely gender of a Chinese name in LATIN (Pinyin).
genderChineseNamePinyinBatch POST /api2/json/genderChineseNamePinyinBatch Infer the likely gender of up to 100 Chinese names in LATIN (Pinyin).
parseChineseName GET /api2/json/parseChineseName/{chineseName} Infer the likely first/last name structure of a name, ex. 王晓明 -> 王(surname) 晓明(given name)
parseChineseNameBatch POST /api2/json/parseChineseNameBatch Infer the likely first/last name structure of a name, ex. 王晓明 -> 王(surname) 晓明(given name).
pinyinChineseName GET /api2/json/pinyinChineseName/{chineseName} Romanize the Chinese name to Pinyin, ex. 王晓明 -> Wang (surname) Xiaoming (given name)
pinyinChineseNameBatch POST /api2/json/pinyinChineseNameBatch Romanize a list of Chinese name to Pinyin, ex. 王晓明 -> Wang (surname) Xiaoming (given name).

chineseNameCandidates

NameMatchCandidatesOut chineseNameCandidates(chineseSurnameLatin, chineseGivenNameLatin)

Identify Chinese name candidates, based on the romanized name ex. Wang Xiaoming

Example

var NamSorApiV2 = require('nam_sor_api_v2');
var defaultClient = NamSorApiV2.ApiClient.instance;
// Configure API key authorization: api_key
var api_key = defaultClient.authentications['api_key'];
api_key.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//api_key.apiKeyPrefix = 'Token';

var apiInstance = new NamSorApiV2.ChineseApi();
var chineseSurnameLatin = "chineseSurnameLatin_example"; // String | 
var chineseGivenNameLatin = "chineseGivenNameLatin_example"; // String | 
var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
apiInstance.chineseNameCandidates(chineseSurnameLatin, chineseGivenNameLatin, callback);

Parameters

Name Type Description Notes
chineseSurnameLatin String
chineseGivenNameLatin String

Return type

NameMatchCandidatesOut

Authorization

api_key

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

chineseNameCandidatesBatch

BatchNameMatchCandidatesOut chineseNameCandidatesBatch(opts)

Identify Chinese name candidates, based on the romanized name (firstName = chineseGivenName; lastName=chineseSurname), ex. Wang Xiaoming

Example

var NamSorApiV2 = require('nam_sor_api_v2');
var defaultClient = NamSorApiV2.ApiClient.instance;
// Configure API key authorization: api_key
var api_key = defaultClient.authentications['api_key'];
api_key.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//api_key.apiKeyPrefix = 'Token';

var apiInstance = new NamSorApiV2.ChineseApi();
var opts = {
  'batchFirstLastNameIn': new NamSorApiV2.BatchFirstLastNameIn() // BatchFirstLastNameIn | A list of personal Chinese names in LATIN, firstName = chineseGivenName; lastName=chineseSurname
};
var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
apiInstance.chineseNameCandidatesBatch(opts, callback);

Parameters

Name Type Description Notes
batchFirstLastNameIn BatchFirstLastNameIn A list of personal Chinese names in LATIN, firstName = chineseGivenName; lastName=chineseSurname [optional]

Return type

BatchNameMatchCandidatesOut

Authorization

api_key

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

chineseNameCandidatesGenderBatch

BatchNameMatchCandidatesOut chineseNameCandidatesGenderBatch(opts)

Identify Chinese name candidates, based on the romanized name (firstName = chineseGivenName; lastName=chineseSurname) ex. Wang Xiaoming.

Example

var NamSorApiV2 = require('nam_sor_api_v2');
var defaultClient = NamSorApiV2.ApiClient.instance;
// Configure API key authorization: api_key
var api_key = defaultClient.authentications['api_key'];
api_key.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//api_key.apiKeyPrefix = 'Token';

var apiInstance = new NamSorApiV2.ChineseApi();
var opts = {
  'batchFirstLastNameGenderIn': new NamSorApiV2.BatchFirstLastNameGenderIn() // BatchFirstLastNameGenderIn | A list of personal Chinese names in LATIN, firstName = chineseGivenName; lastName=chineseSurname
};
var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
apiInstance.chineseNameCandidatesGenderBatch(opts, callback);

Parameters

Name Type Description Notes
batchFirstLastNameGenderIn BatchFirstLastNameGenderIn A list of personal Chinese names in LATIN, firstName = chineseGivenName; lastName=chineseSurname [optional]

Return type

BatchNameMatchCandidatesOut

Authorization

api_key

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

chineseNameGenderCandidates

NameMatchCandidatesOut chineseNameGenderCandidates(chineseSurnameLatin, chineseGivenNameLatin, knownGender)

Identify Chinese name candidates, based on the romanized name ex. Wang Xiaoming - having a known gender ('male' or 'female')

Example

var NamSorApiV2 = require('nam_sor_api_v2');
var defaultClient = NamSorApiV2.ApiClient.instance;
// Configure API key authorization: api_key
var api_key = defaultClient.authentications['api_key'];
api_key.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//api_key.apiKeyPrefix = 'Token';

var apiInstance = new NamSorApiV2.ChineseApi();
var chineseSurnameLatin = "chineseSurnameLatin_example"; // String | 
var chineseGivenNameLatin = "chineseGivenNameLatin_example"; // String | 
var knownGender = "knownGender_example"; // String | 
var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
apiInstance.chineseNameGenderCandidates(chineseSurnameLatin, chineseGivenNameLatin, knownGender, callback);

Parameters

Name Type Description Notes
chineseSurnameLatin String
chineseGivenNameLatin String
knownGender String

Return type

NameMatchCandidatesOut

Authorization

api_key

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

chineseNameMatch

NameMatchedOut chineseNameMatch(chineseSurnameLatin, chineseGivenNameLatin, chineseName)

Return a score for matching Chinese name ex. 王晓明 with a romanized name ex. Wang Xiaoming

Example

var NamSorApiV2 = require('nam_sor_api_v2');
var defaultClient = NamSorApiV2.ApiClient.instance;
// Configure API key authorization: api_key
var api_key = defaultClient.authentications['api_key'];
api_key.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//api_key.apiKeyPrefix = 'Token';

var apiInstance = new NamSorApiV2.ChineseApi();
var chineseSurnameLatin = "chineseSurnameLatin_example"; // String | 
var chineseGivenNameLatin = "chineseGivenNameLatin_example"; // String | 
var chineseName = "chineseName_example"; // String | 
var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
apiInstance.chineseNameMatch(chineseSurnameLatin, chineseGivenNameLatin, chineseName, callback);

Parameters

Name Type Description Notes
chineseSurnameLatin String
chineseGivenNameLatin String
chineseName String

Return type

NameMatchedOut

Authorization

api_key

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

chineseNameMatchBatch

BatchNameMatchedOut chineseNameMatchBatch(opts)

Identify Chinese name candidates, based on the romanized name (firstName = chineseGivenName; lastName=chineseSurname), ex. Wang Xiaoming

Example

var NamSorApiV2 = require('nam_sor_api_v2');
var defaultClient = NamSorApiV2.ApiClient.instance;
// Configure API key authorization: api_key
var api_key = defaultClient.authentications['api_key'];
api_key.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//api_key.apiKeyPrefix = 'Token';

var apiInstance = new NamSorApiV2.ChineseApi();
var opts = {
  'batchMatchPersonalFirstLastNameIn': new NamSorApiV2.BatchMatchPersonalFirstLastNameIn() // BatchMatchPersonalFirstLastNameIn | A list of personal Chinese names in LATIN, firstName = chineseGivenName; lastName=chineseSurname
};
var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
apiInstance.chineseNameMatchBatch(opts, callback);

Parameters

Name Type Description Notes
batchMatchPersonalFirstLastNameIn BatchMatchPersonalFirstLastNameIn A list of personal Chinese names in LATIN, firstName = chineseGivenName; lastName=chineseSurname [optional]

Return type

BatchNameMatchedOut

Authorization

api_key

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

genderChineseName

PersonalNameGenderedOut genderChineseName(chineseName)

Infer the likely gender of a Chinese full name ex. 王晓明

Example

var NamSorApiV2 = require('nam_sor_api_v2');
var defaultClient = NamSorApiV2.ApiClient.instance;
// Configure API key authorization: api_key
var api_key = defaultClient.authentications['api_key'];
api_key.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//api_key.apiKeyPrefix = 'Token';

var apiInstance = new NamSorApiV2.ChineseApi();
var chineseName = "chineseName_example"; // String | 
var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
apiInstance.genderChineseName(chineseName, callback);

Parameters

Name Type Description Notes
chineseName String

Return type

PersonalNameGenderedOut

Authorization

api_key

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

genderChineseNameBatch

BatchPersonalNameGenderedOut genderChineseNameBatch(opts)

Infer the likely gender of up to 100 full names ex. 王晓明

Example

var NamSorApiV2 = require('nam_sor_api_v2');
var defaultClient = NamSorApiV2.ApiClient.instance;
// Configure API key authorization: api_key
var api_key = defaultClient.authentications['api_key'];
api_key.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//api_key.apiKeyPrefix = 'Token';

var apiInstance = new NamSorApiV2.ChineseApi();
var opts = {
  'batchPersonalNameIn': new NamSorApiV2.BatchPersonalNameIn() // BatchPersonalNameIn | A list of personal names, with a country ISO2 code
};
var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
apiInstance.genderChineseNameBatch(opts, callback);

Parameters

Name Type Description Notes
batchPersonalNameIn BatchPersonalNameIn A list of personal names, with a country ISO2 code [optional]

Return type

BatchPersonalNameGenderedOut

Authorization

api_key

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

genderChineseNamePinyin

FirstLastNameGenderedOut genderChineseNamePinyin(chineseSurnameLatin, chineseGivenNameLatin)

Infer the likely gender of a Chinese name in LATIN (Pinyin).

Example

var NamSorApiV2 = require('nam_sor_api_v2');
var defaultClient = NamSorApiV2.ApiClient.instance;
// Configure API key authorization: api_key
var api_key = defaultClient.authentications['api_key'];
api_key.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//api_key.apiKeyPrefix = 'Token';

var apiInstance = new NamSorApiV2.ChineseApi();
var chineseSurnameLatin = "chineseSurnameLatin_example"; // String | 
var chineseGivenNameLatin = "chineseGivenNameLatin_example"; // String | 
var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
apiInstance.genderChineseNamePinyin(chineseSurnameLatin, chineseGivenNameLatin, callback);

Parameters

Name Type Description Notes
chineseSurnameLatin String
chineseGivenNameLatin String

Return type

FirstLastNameGenderedOut

Authorization

api_key

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

genderChineseNamePinyinBatch

BatchFirstLastNameGenderedOut genderChineseNamePinyinBatch(opts)

Infer the likely gender of up to 100 Chinese names in LATIN (Pinyin).

Example

var NamSorApiV2 = require('nam_sor_api_v2');
var defaultClient = NamSorApiV2.ApiClient.instance;
// Configure API key authorization: api_key
var api_key = defaultClient.authentications['api_key'];
api_key.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//api_key.apiKeyPrefix = 'Token';

var apiInstance = new NamSorApiV2.ChineseApi();
var opts = {
  'batchFirstLastNameIn': new NamSorApiV2.BatchFirstLastNameIn() // BatchFirstLastNameIn | A list of names, with country code.
};
var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
apiInstance.genderChineseNamePinyinBatch(opts, callback);

Parameters

Name Type Description Notes
batchFirstLastNameIn BatchFirstLastNameIn A list of names, with country code. [optional]

Return type

BatchFirstLastNameGenderedOut

Authorization

api_key

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

parseChineseName

PersonalNameParsedOut parseChineseName(chineseName)

Infer the likely first/last name structure of a name, ex. 王晓明 -> 王(surname) 晓明(given name)

Example

var NamSorApiV2 = require('nam_sor_api_v2');
var defaultClient = NamSorApiV2.ApiClient.instance;
// Configure API key authorization: api_key
var api_key = defaultClient.authentications['api_key'];
api_key.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//api_key.apiKeyPrefix = 'Token';

var apiInstance = new NamSorApiV2.ChineseApi();
var chineseName = "chineseName_example"; // String | 
var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
apiInstance.parseChineseName(chineseName, callback);

Parameters

Name Type Description Notes
chineseName String

Return type

PersonalNameParsedOut

Authorization

api_key

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

parseChineseNameBatch

BatchPersonalNameParsedOut parseChineseNameBatch(opts)

Infer the likely first/last name structure of a name, ex. 王晓明 -> 王(surname) 晓明(given name).

Example

var NamSorApiV2 = require('nam_sor_api_v2');
var defaultClient = NamSorApiV2.ApiClient.instance;
// Configure API key authorization: api_key
var api_key = defaultClient.authentications['api_key'];
api_key.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//api_key.apiKeyPrefix = 'Token';

var apiInstance = new NamSorApiV2.ChineseApi();
var opts = {
  'batchPersonalNameIn': new NamSorApiV2.BatchPersonalNameIn() // BatchPersonalNameIn | A list of personal names
};
var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
apiInstance.parseChineseNameBatch(opts, callback);

Parameters

Name Type Description Notes
batchPersonalNameIn BatchPersonalNameIn A list of personal names [optional]

Return type

BatchPersonalNameParsedOut

Authorization

api_key

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

pinyinChineseName

PersonalNameParsedOut pinyinChineseName(chineseName)

Romanize the Chinese name to Pinyin, ex. 王晓明 -> Wang (surname) Xiaoming (given name)

Example

var NamSorApiV2 = require('nam_sor_api_v2');
var defaultClient = NamSorApiV2.ApiClient.instance;
// Configure API key authorization: api_key
var api_key = defaultClient.authentications['api_key'];
api_key.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//api_key.apiKeyPrefix = 'Token';

var apiInstance = new NamSorApiV2.ChineseApi();
var chineseName = "chineseName_example"; // String | 
var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
apiInstance.pinyinChineseName(chineseName, callback);

Parameters

Name Type Description Notes
chineseName String

Return type

PersonalNameParsedOut

Authorization

api_key

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

pinyinChineseNameBatch

BatchPersonalNameParsedOut pinyinChineseNameBatch(opts)

Romanize a list of Chinese name to Pinyin, ex. 王晓明 -> Wang (surname) Xiaoming (given name).

Example

var NamSorApiV2 = require('nam_sor_api_v2');
var defaultClient = NamSorApiV2.ApiClient.instance;
// Configure API key authorization: api_key
var api_key = defaultClient.authentications['api_key'];
api_key.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//api_key.apiKeyPrefix = 'Token';

var apiInstance = new NamSorApiV2.ChineseApi();
var opts = {
  'batchPersonalNameIn': new NamSorApiV2.BatchPersonalNameIn() // BatchPersonalNameIn | A list of Chinese names
};
var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
apiInstance.pinyinChineseNameBatch(opts, callback);

Parameters

Name Type Description Notes
batchPersonalNameIn BatchPersonalNameIn A list of Chinese names [optional]

Return type

BatchPersonalNameParsedOut

Authorization

api_key

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json