@@ -33,13 +33,13 @@ def __init__(self):
3333 """
3434
3535 @abstractmethod
36- def add_annotation_raw (self , type_id : int , begin : int , end : int ) -> int :
36+ def add_annotation_raw (self , type_name : str , begin : int , end : int ) -> int :
3737 r"""This function adds an annotation entry with `begin` and `end`
38- indices to the (`type_id`)th sortedlist in `self.__elements`,
38+ indices to the `type_name` sortedlist in `self.__elements`,
3939 returns the `tid` for the inserted entry.
4040
4141 Args:
42- type_id (int ): The index of Annotation sortedlist in `self.__elements`.
42+ type_name (str ): The index of Annotation sortedlist in `self.__elements`.
4343 begin (int): Begin index of the entry.
4444 end (int): End index of the entry.
4545 Returns:
@@ -49,37 +49,39 @@ def add_annotation_raw(self, type_id: int, begin: int, end: int) -> int:
4949
5050 @abstractmethod
5151 def add_link_raw (
52- self , type_id : int , parent_tid : int , child_tid : int
52+ self , type_name : str , parent_tid : int , child_tid : int
5353 ) -> Tuple [int , int ]:
5454 r"""This function adds a link entry with `parent_tid` and `child_tid`
55- to the (`type_id`)th list in `self.__elements`, returns the `tid` and the
55+ to the `type_name` list in `self.__elements`, returns the `tid` and the
5656 `index_id` for the inserted entry in the list. This `index_id` is the
57- index of the entry in the (`type_id`)th list.
57+ index of the entry in the `type_name` list.
5858
5959 Args:
60- type_id (int ): The index of Link list in `self.__elements`.
60+ type_name (str ): The index of Link list in `self.__elements`.
6161 parent_tid (int): `tid` of the parent entry.
6262 child_tid (int): `tid` of the child entry.
6363
6464 Returns:
65- `tid` of the entry and its index in the (`type_id`)th list.
65+ `tid` of the entry and its index in the `type_name` list.
6666
6767 """
6868 raise NotImplementedError
6969
7070 @abstractmethod
71- def add_group_raw (self , type_id : int , member_type : str ) -> Tuple [int , int ]:
71+ def add_group_raw (
72+ self , type_name : str , member_type : str
73+ ) -> Tuple [int , int ]:
7274 r"""This function adds a group entry with `member_type` to the
73- (`type_id`)th list in `self.__elements`, returns the `tid` and the
75+ `type_name` list in `self.__elements`, returns the `tid` and the
7476 `index_id` for the inserted entry in the list. This `index_id` is the
75- index of the entry in the (`type_id`)th list.
77+ index of the entry in the `type_name` list.
7678
7779 Args:
78- type_id (int ): The index of Group list in `self.__elements`.
80+ type_name (str ): The index of Group list in `self.__elements`.
7981 member_type (str): Fully qualified name of its members.
8082
8183 Returns:
82- `tid` of the entry and its index in the (`type_id`)th list.
84+ `tid` of the entry and its index in the `type_name` list.
8385
8486 """
8587 raise NotImplementedError
@@ -154,25 +156,25 @@ def delete_entry(self, tid: int):
154156 @abstractmethod
155157 def get_entry (self , tid : int ) -> Tuple [List , int , int ]:
156158 r"""Look up the entry_dict with key `tid`. Return the entry,
157- its `type_id `, and its `index_id` in the `entry_type` list.
159+ its `type_name `, and its `index_id` in the `entry_type` list.
158160
159161 Args:
160162 tid (int): Unique id of the entry.
161163
162164 Returns:
163- The entry which `tid` corresponds to, its `type_id ` and its index
165+ The entry which `tid` corresponds to, its `type_name ` and its index
164166 in the `entry_type` list.
165167
166168 """
167169 raise NotImplementedError
168170
169171 @abstractmethod
170- def get (self , type_id : int , include_sub_type : bool ) -> Iterator [List ]:
172+ def get (self , type_name : str , include_sub_type : bool ) -> Iterator [List ]:
171173 r"""This function fetches entries from the data store of
172- type self.__type_dict[`type_id`] .
174+ type `type_name` .
173175
174176 Args:
175- type_id (int) ): The index of the list in `self.__elements`.
177+ type_name (str ): The index of the list in `self.__elements`.
176178 include_sub_type: A boolean to indicate whether get its subclass.
177179
178180 Returns:
0 commit comments