semantics

Why would one choose an editable DIV over an INPUT or TEXTAREA

大兔子大兔子 提交于 2019-12-05 03:26:08
There are several questions about asking how to make a div editable. However one could just use a textarea or input field and make those disabled or readonly. I would guess this would yield better semantics. Even the example given at MDN looks like a plain old input field to me. So why would I use an editable div? What are its advantages over textareas and input fields? I just had a look at an example I found in the tag wiki contenteditable . Is the advantage, that I can use markup inside an editable div, but not inside a textarea or an input field? Wouldn't it then be more semantically

Why do I need a tokenizer for each language? [closed]

笑着哭i 提交于 2019-12-05 02:19:49
Closed . This question needs to be more focused . It is not currently accepting answers. Want to improve this question? Update the question so it focuses on one problem only by editing this post . Closed 5 years ago . When processing text, why would one need a tokenizer specialized for the language? Wouldn't tokenizing by whitespace be enough? What are the cases where it is not good idea to use simply a white space tokenization? Tokenization is the identification of linguistically meaningful units (LMU) from the surface text. Chinese : 如果您在新加坡只能前往一间夜间娱乐场所,Zouk必然是您的不二之选。 English : If you only

Ambiguity in the standard on undefined behaviour of out of range pointer

China☆狼群 提交于 2019-12-04 16:10:15
ISO IEC 14882-2011 §5.7/5 States: If both the pointer operand and the result point to elements of the same array object, or one past the last element of the array object, the evaluation shall not produce an overflow; otherwise, the behavior is undefined. This section is used here on stackoverflow from time to time. For instance to argue why the increment of a pointer to nullptr is UB like here . It is then interpreted as, having a pointer that does not point to an element of an array object. Is undefined behaviour. However, when I read this I understood it to refer to the evaluation of the

Friendly url scheme?

那年仲夏 提交于 2019-12-04 14:07:24
问题 One of the many things that's been lacking from my scraper service that I set up last week are pretty URLs. Right now the user parameter is being passed into the script with ?u= , which is a symptom of a lazy hack (which the script admittedly is). However, I've been thinking about redoing it and I'd like to get some feedback on the options available. Right now there are two pages, update and chart, that provide information to the user. Here are the two possibilities that I came up with. "1234

Representing Natural Language as RDF

家住魔仙堡 提交于 2019-12-04 09:16:30
问题 How much of the concepts conveyed in natural language is RDF/OWL able to represent? I'm still learning RDF and other semantic technologies, but as I currently understand it, information is typically represented as triples of the form (subject,predicate,object). So I can imagine how the sentence "Bob has a hat" might be represented. However, how would you represent a more complicated sentence like "Bob, over on 42nd street, will have a job at the Mall after the owner approves"? Are there

When a value is added via Map.put(K, V), must the same instance be returned via Map.get(K)?

泪湿孤枕 提交于 2019-12-04 08:32:53
Suppose you have this code: Map<Foo, Bar> map = new HashMap<Foo, Bar>(); Foo foo = new Foo(); Bar bar = new Bar(); map.put(foo, bar); Bar barReturned = map.get(foo); Does Java require that barReturned == bar ? That is, does Java require that barReturned be the same instance as bar ? If not, what semantics are expected? The Javadoc suggests that barReturned == bar must be true, but I'm not 100% sure: V get(Object key) Returns the value to which the specified key is mapped, or null if this map contains no mapping for the key. More formally, if this map contains a mapping from a key k to a value

How to create a basic semantic search in python

女生的网名这么多〃 提交于 2019-12-04 07:23:20
I want to write a basic semantic web crawler using Python, I know that semantic apps use RDF files, but what else? I have some Python RDF modules installed and I started learning how they work. Could you introduce me to the technologies and techniques used in a semantic application? Lev Khomich The next things you might want to learn are: embedding samantic data in HTML - RDFa , microformats , microdata . Some stats: microformats and RDFa deployment across the Web via DAM.co.uk : querying RDF data - SPARQL most popular ontologies currently in use list of available SPARQL endpoints You can find

NLTK relation extraction returns nothing

浪子不回头ぞ 提交于 2019-12-04 06:20:23
I am recently working on using nltk to extract relation from text. so i build a sample text:" Tom is the cofounder of Microsoft." and using following program to test and return nothing. I cannot figure out why. I'm using NLTK version: 3.2.1, python version: 3.5.2. Here is my code: import re import nltk from nltk.sem.relextract import extract_rels, rtuple from nltk.tokenize import sent_tokenize, word_tokenize def test(): with open('sample.txt', 'r') as f: sample = f.read() # "Tom is the cofounder of Microsoft" sentences = sent_tokenize(sample) tokenized_sentences = [word_tokenize(sentence) for

Does a <button> TYPE have to be defined?

ぐ巨炮叔叔 提交于 2019-12-04 05:34:39
问题 When using the button tag, does the type attribute have to be defined, or is it semantic to just have? <button>Click Me</button> 回答1: No, you don't have to specify it, it defaults to the value submit . See the HTML 4.x specification: type (button|submit|reset) submit -- for use as form button -- ^^^^^^ default value Compare with the action attribute for forms where it says #REQUIRED instead of giving a default value. action %URI; #REQUIRED -- server-side form handler -- 回答2: As @Quentin’s

Does the use of the fieldset HTML tag have meaning beyond grouping forms?

冷暖自知 提交于 2019-12-04 02:49:01
问题 Usually, I've seen it with forms, but I've found it helpful to group related sets of data (eg when you have multiple tables on a page, using a fieldset around each table or group of related tables to define a visible meaning and a group name (legend)). Is this abusing the fieldset tag to the point where, in my uses, it no longer has semantic meaning? 回答1: I can see semantic advantages to blocking content into fieldsets with legends. Although the W3C associated the use of fieldsets and legends