📄 identifier.h
字号:
// file: $isip/class/asr/Identifier/Identifier.h// version: $Id: Identifier.h,v 1.4 2002/09/01 18:42:02 alphonso Exp $//// make sure definitions are only made once//#ifndef ISIP_IDENTIFIER#define ISIP_IDENTIFIER#ifndef ISIP_STRING#include <String.h>#endif#ifndef ISIP_HASH_TABLE#include <HashTable.h>#endif#ifndef ISIP_DOUBLE_LINKED_LIST#include <DoubleLinkedList.h>#endif#ifndef ISIP_ANCHOR#include <Anchor.h>#endif#ifndef ISIP_ANNOTATION#include <Annotation.h>#endif// Identifier: a class used to represent an identifier//// Reference://// [1] S. Bird, M. Liberman, A Formal Framework for Linguistic Annotation,// Linguistic Data Consortium, University of Pennsylvania, Philadelphia,// Pennsylvania, USA, 2000.//// [2] K. Maeda, X. Ma, H. Lee, S. Bird, The Annotation Graph Toolkit:// Application Developer's Manual (Draft), Linguistic Data Consortium,// University of Pennsylvania, Philadelphia, Pennsylvania, USA, 2001.//class Identifier { //-------------------------------------------------------------------------- // // public constants // //--------------------------------------------------------------------------public: // define the class name // static const String CLASS_NAME; // i/o related constants // static const String DEF_PARAM; //--------------------------------------------------------------------------- // // protected data // //--------------------------------------------------------------------------- protected: // declare the identifier namespace // String namespace_d; // declare the identifier type // String type_d; // define the collection of identifiers already issued // DoubleLinkedList<String> issued_d; // define the highest id issued so far // Long curr_d; // define the table of anchors // HashTable<String, Anchor> anchors_d; // define the table of annotations // HashTable<String, Annotation> annotations_d; // declare a static debug level for all class instantiations // static Integral::DEBUG debug_level_d; // a static memory manager // static MemoryManager mgr_d; //--------------------------------------------------------------------------- // // required public methods // //---------------------------------------------------------------------------public: // method: name // static const String& name() { return CLASS_NAME; } static boolean diagnose(Integral::DEBUG debug_level); // debug methods // boolean debug(const unichar* msg) const; // method: setDebug // static boolean setDebug(Integral::DEBUG arg) { debug_level_d = arg; return true; } // method: destructor // ~Identifier() {} // method: default constructor // Identifier(); // method: copy constructor // Identifier(const Identifier& arg) { assign(arg); } // method: assign // boolean assign(const Identifier& arg); // method: sofSize // long sofSize() const { return 0; } // method: read // boolean read(Sof& sof, long tag) { return read(sof, tag, name()); } // method: write // boolean write(Sof& sof, long tag) const { return write(sof, tag, name()); } // method: read // boolean read(Sof& sof, long tag, const String& name) { return true; } // method: readData // boolean readData(Sof& sof, const String& pname = DEF_PARAM, long size = SofParser::FULL_OBJECT, boolean param = true, boolean nested = false) { return true; } // method: write // boolean write(Sof& sof, long tag, const String& name) const { return true; } // method: writeData // boolean writeData(Sof& sof, const String& pname = DEF_PARAM) const { return true; } // method: eq // boolean eq(const Identifier& arg) const; // method: new // static void* operator new(size_t arg) { return mgr_d.get(); } // method: new[] // static void* operator new[](size_t arg) { return mgr_d.getBlock(arg); } // method: delete // static void operator delete(void* arg) { mgr_d.release(arg); } // method: delete[] // static void operator delete[](void* arg) { mgr_d.releaseBlock(arg); } // method: setGrowSize // static boolean setGrowSize(long arg) { return mgr_d.setGrow(arg); } // method: clear // boolean clear(Integral::CMODE cmode = Integral::DEF_CMODE); //--------------------------------------------------------------------------- // // class-specific public methods // //--------------------------------------------------------------------------- // method: constructor // Identifier(String& id, String& type); // method to try to register the given identifier // const String registerId(); // method to try to register the given identifier // const String registerId(const String& id); /// method to check if an id has been issued // boolean existsId(const String& id); /// method to reclaim an id // boolean reclaimId(const String& id); // method to get the namespace of the id // String getNamespace(const String& id); // method to get the annotation reference by id // Annotation* getAnnotationRef(const String& id); // method to get get the anchor reference by id // Anchor* getAnchorRef(const String& id); // method to delete a annotation id to reference mapping // boolean deleteAnnotationRef(const String& id); // method to delete a anchor id to reference mapping // boolean deleteAnchorRef(const String& id); // method to add a annotation id to reference mapping // boolean addAnnotationRef(const String& id, Annotation* ref); // method to add a anchor id to reference mapping // boolean addAnchorRef(const String& id, Anchor* ref); // method to check if a annotation exists // boolean existsAnnotation(const String& id); // method to check if a anchor exists // boolean existsAnchor(const String& id); //--------------------------------------------------------------------------- // // private methods // //--------------------------------------------------------------------------- private:};//end of include file//#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -