Skip to content
 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

text-annotation

Text Annotation

Demo plunker
Project demo on github

Cài đặt

** Các thư viện yêu cầu**

<link rel="stylesheet" href="bootstrap.min.css">
<link> rel="stylesheet" href="fontawesome.css">

<script src="underscore.js"></script>
<script src="jquery.js"></script>
<script src="jquery.svg.min.js"></script>
<script src="brat.js"></script>
<script src="angular.min.js"></script>
<script src="bootstrap.min.js"></script>
<script src="ui-bootstrap-tpls.min.js"></script>



Thêm javascript và css vào index.html

Chú ý: Thuộc tính component bắt buộc phải có trong thẻ script

<link rel="stylesheet" href="text-annotation.css">

<script src="brat.js">
<script component="text-annotation-script" src="text-annotation.js">
<script src="update-annotation-modal.js">
<script src="new-annotation-modal.js">

Khai báo directive

<text-annotation config="config" doc="doc" editable="true" multilabel="false" confirm="true"><text-annotation>
  • Khai báo các file text-annotation.js, update-annotation-modal.js, new-annotation-modal.js
  • Tham số: truyền giá trị cho các tham số, configdoc truyền từ controller với $scope, hai tham số còn lại editablemultilabel nhận hai giá trị truefalse.

Các tham số trong directive

  • component (bắt buộc) - có giá trị text-annotation-script là thuộc tính của thẻ script khai báo directive, nhằm xác định đường dẫn tới thư mục chứa code html của các modal annotation.
  • config (bắt buộc) - cấu hình nhãn của text
  • doc (bắt buộc) - chứa text và các entities cúa các thành phần trong text
  • editable (mặc định: false) - thay đổi nhãn cho text
    true: có thể mở modal update và thêm mới entity cho token
    false: không thể mở modal nào
  • multilabel (mặc định: false) - gán nhiều nhãn cho một token.
    true: mở modal thêm mới, lọc bỏ những entity đã tồn tại trong token được chọn trong danh sách entity. Cần đặt giá trị cho editabletrue thì tham số multilabel mới có thể nhận sự kiện.
    false: không cho mở modal thêm mới
  • confirm (mạc định: true) - hiển thị alert xác nhận thao tác

Hướng dẫn sử dụng

  • Mở modal cập nhật hoặc xóa nhãn bằng cách click vào tên nhãn bên trên token.
  • Mở modal thêm mới nhãn bằng cách click đúp hoặc bôi đen một đoạn trong text.

About

No description or website provided.

Topics

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages