bt_ne_types.h File Reference

Type codes for named entities detected by RLP. More...

#include "bt_types.h"

Include dependency graph for bt_ne_types.h:

This graph shows which files directly or indirectly include this file:


Defines

#define BT_NE_GET_SUBTYPE(t)   ((t) & 0x000000FF)
#define BT_NE_GET_TYPE(t)   ((t) & 0x00FFFF00)
#define BT_NE_IS_FACILITY(t)   ( BT_NE_GET_TYPE(t) == BT_NE_TYPE_FACILITY )
 Determines if the named entity is a FACILITY.
#define BT_NE_IS_GPE(t)   ( BT_NE_GET_TYPE(t) == BT_NE_TYPE_GPE )
 Determines if the named entity is a GPE.
#define BT_NE_IS_IDENTIFIER(t)   ( BT_NE_GET_TYPE(t) == BT_NE_TYPE_IDENTIFIER )
 Determines if the named entity is a IDENTIFIER.
#define BT_NE_IS_LOCATION(t)   ( BT_NE_GET_TYPE(t) == BT_NE_TYPE_LOCATION )
 Determines if the named entity is a LOCATION.
#define BT_NE_IS_NATIONALITY(t)   ( BT_NE_GET_TYPE(t) == BT_NE_TYPE_NATIONALITY )
 Determines if the named entity is a NATIONALITY.
#define BT_NE_IS_NONE(t)   ( BT_NE_GET_TYPE(t) == BT_NE_TYPE_NONE )
 Determines if the named entity is a NONE.
#define BT_NE_IS_ORGANIZATION(t)   ( BT_NE_GET_TYPE(t) == BT_NE_TYPE_ORGANIZATION )
 Determines if the named entity is a ORGANIZATION.
#define BT_NE_IS_PERSON(t)   ( BT_NE_GET_TYPE(t) == BT_NE_TYPE_PERSON )
 Determines if the named entity is a PERSON.
#define BT_NE_IS_RELIGION(t)   ( BT_NE_GET_TYPE(t) == BT_NE_TYPE_RELIGION )
 Determines if the named entity is a RELIGION.
#define BT_NE_IS_TEMPORAL(t)   ( BT_NE_GET_TYPE(t) == BT_NE_TYPE_TEMPORAL )
 Determines if the named entity is a TEMPORAL.
#define BT_NE_IS_TITLE(t)   ( BT_NE_GET_TYPE(t) == BT_NE_TYPE_TITLE )
 Determines if the named entity is a TITLE.
#define BT_NE_IS_VEHICLE(t)   ( BT_NE_GET_TYPE(t) == BT_NE_TYPE_VEHICLE )
 Determines if the named entity is a VEHICLE.
#define BT_NE_IS_WEAPON(t)   ( BT_NE_GET_TYPE(t) == BT_NE_TYPE_WEAPON )
 Determines if the named entity is a WEAPON.
#define BT_NE_TYPE_CLIENT_START   (0x1000 << 8)
#define BT_NE_TYPE_FACILITY   (0x0004 << 8)
 Facility name.
#define BT_NE_TYPE_GPE   (0x0005 << 8)
 Geo-political entity.
#define BT_NE_TYPE_IDENTIFIER   (0x0009 << 8)
 Electronic or other ephemeral identifier.
#define BT_NE_TYPE_IDENTIFIER_CREDIT_CARD_NUM   (BT_NE_TYPE_IDENTIFIER | 0x09)
 A credit card number.
#define BT_NE_TYPE_IDENTIFIER_DISTANCE   (BT_NE_TYPE_IDENTIFIER | 0x0D)
 Distance.
#define BT_NE_TYPE_IDENTIFIER_DOMAIN_NAME   (BT_NE_TYPE_IDENTIFIER | 0x03)
 An Internet domain name.
#define BT_NE_TYPE_IDENTIFIER_EMAIL   (BT_NE_TYPE_IDENTIFIER | 0x01)
 An E-mail address.
#define BT_NE_TYPE_IDENTIFIER_FAX_NUMBER   (BT_NE_TYPE_IDENTIFIER | 0x06)
 A fax number.
#define BT_NE_TYPE_IDENTIFIER_IP_ADDRESS   (BT_NE_TYPE_IDENTIFIER | 0x04)
 An Internet IP address.
#define BT_NE_TYPE_IDENTIFIER_LATITUDE_LONGITUDE   (BT_NE_TYPE_IDENTIFIER | 0x08)
 Latitude Longitude Coordinates.
#define BT_NE_TYPE_IDENTIFIER_MONEY   (BT_NE_TYPE_IDENTIFIER | 0x0A)
 Monetary amounts.
#define BT_NE_TYPE_IDENTIFIER_NUMBER   (BT_NE_TYPE_IDENTIFIER | 0x0E)
 Number.
#define BT_NE_TYPE_IDENTIFIER_PERCENT   (BT_NE_TYPE_IDENTIFIER | 0x0B)
 Percentages.
#define BT_NE_TYPE_IDENTIFIER_PERSONAL_ID_NUM   (BT_NE_TYPE_IDENTIFIER | 0x07)
 Personal ID number, such as a US SSN.
#define BT_NE_TYPE_IDENTIFIER_PHONE_NUMBER   (BT_NE_TYPE_IDENTIFIER | 0x05)
 A telephone (landline, mobile) number.
#define BT_NE_TYPE_IDENTIFIER_URL   (BT_NE_TYPE_IDENTIFIER | 0x02)
 A URL.
#define BT_NE_TYPE_IDENTIFIER_UTM   (BT_NE_TYPE_IDENTIFIER | 0x0C)
 Universal Transverse Mercator Coordinates.
#define BT_NE_TYPE_LOCATION   (0x0003 << 8)
 Location name.
#define BT_NE_TYPE_NATIONALITY   (0x000B << 8)
 Nationality types.
#define BT_NE_TYPE_NONE   (0x0000 << 8)
 Unknown or uncodable.
#define BT_NE_TYPE_ORGANIZATION   (0x0002 << 8)
 Organizations.
#define BT_NE_TYPE_PERSON   (0x0001 << 8)
 Persons.
#define BT_NE_TYPE_RELIGION   (0x000A << 8)
 Religion types.
#define BT_NE_TYPE_TEMPORAL   (0x0008 << 8)
 Times and Dates.
#define BT_NE_TYPE_TEMPORAL_DATE   (BT_NE_TYPE_TEMPORAL | 0x01)
 A date.
#define BT_NE_TYPE_TEMPORAL_TIME   (BT_NE_TYPE_TEMPORAL | 0x02)
 A time.
#define BT_NE_TYPE_TITLE   (0x000C << 8)
 Title types.
#define BT_NE_TYPE_VEHICLE   (0x0006 << 8)
 Vehicle types.
#define BT_NE_TYPE_WEAPON   (0x0007 << 8)
 Weapon types.

Functions

BT_UInt32 BT_NE_String_To_Type (char const *typeName, int *errorFlag)
 Map a named entity type string into its integer code.
const char * BT_NE_Type_To_String (BT_UInt32 type)
 Map a named entity type into a string form.

Detailed Description

This file defines the types of named entities that can (or will be) detected by named-entity processors within the RLP.

Note* that the type <-> string functions will not work with user defined named entity types. Use the functions defined in bt_rlp_ne_types.h to access these along with the built-in types.


Define Documentation

#define BT_NE_GET_SUBTYPE (  )     ((t) & 0x000000FF)

Returns the named entity's subtype.

#define BT_NE_GET_TYPE (  )     ((t) & 0x00FFFF00)

Entities are identified by a 32-bit unsigned integer value which consists of two unsigned 8-bit fields & one unsigned 16 bit field.

The upper 8-bits encode the source language processor id of the entity.(used within RLP only) The middle 16-bits encode the primary type of the entity. The lower 8-bits encode the subtype, if any.

The entity represented by 0x00000000 is NONE, i.e., no classification of any kind has been performed. A token range should never be taged as NONE by any lp, thus the NONE entity also represents error cases.

The value 0x00 represents the general subtype(the type with no specific subtype)

User defined types are all handled within rlp via the ne-types.xml configuration file

This file is provided for convience in comparing type results with the built in types, However be sure to strip the source using BT_RM_SOURCE as defined in bt_rlp_ne_types.h before comparing

Returns the named entity's type.

#define BT_NE_TYPE_CLIENT_START   (0x1000 << 8)

Start number for user-defined named entities.


Function Documentation

BT_UInt32 BT_NE_String_To_Type ( char const *  typeName,
int *  errorFlag 
)

This function converts an entity type from a string into an integer code.

Parameters:
typeName the string value for the type, in the format Major:Minor
errorFlag If the string does not represent an entity type, this is set to 1.

const char* BT_NE_Type_To_String ( BT_UInt32  type  ) 

This function maps an entity type to its string equivalent.

Parameters:
type Entity type.
Returns:
Constant string value for the entity type.


Copyright © 2004-2008 Basis Technology Corporation. All Rights Reserved.