icu-messageformat-parser _isWhiteSpace Uses Pattern_White_Space not White_Space - formatjs

_isWhiteSpace claims to be based on \p{White_Space} but it seems actually to be using \p{Pattern_White_Space}. Is this expected behavior? A related unit test appears to be using the left-to right mark character (U+200E), a member of the former category, in place of the NBSP (U+00A0), a member of the latter.

Related

A question about AUTOSAR, does [constr_1221] apply to Initial Value Representation at level 2?

When i use a NumericalValueSpecification to init value for an ApplicationPrimitiveDataType of category 'BOOLEAN' with a NonqueuedSenderComSpec, it can correctly generate RTE codes without any compilation error, but as [constr_1221] said, if a DataPrototype is typed by an ApplicationPrimitiveDataType its initValue shall be provided by an ApplicationValueSpecification. So, does [constr_1221] apply to Initial Value Representation at level 2?
Yes, any DataPrototype that is typed by an ApplicationDataType shall only be initialized by means of an ApplicationValueSpecification. A NumericalValueSpecification or TextValueSpecification can be used to initialize a DataPrototype typed by an ImplementationDataType.

Freemarker: How to check for ?api-able type (v 2.3.26)

In Freemarker, I have a Map<Map<...>> in the model.
Due to FM glitch, querying for 2nd level Map needs ?api. However, that escapes the normal value existence checks and complicates things.
This is what I have:
<#if sortedStatsMap[rowTag.name]?? && sortedStatsMap[rowTag.name]?is_hash>
${mapToJson(sortedStatsMap[rowTag.name]?api.get(boxTag.name))!}
</#if>
This ends up with:
APINotSupportedTemplateException: The value doesn't support ?api. See requirements in the FreeMarker Manual.
(FTL type: sequence+extended_hash+string (wrapper: f.c.DefaultToExpression$EmptyStringAndSequence),
TemplateModel class: f.c.DefaultToExpression$EmptyStringAndSequence,
ObjectWapper: freemarker.template.DefaultObjectWrapper#1074040321(2.3.26, useAdaptersForContainers=true, forceLegacyNonListCollections=true, iterableSupport=trueexposureLevel=1, exposeFields=false, treatDefaultMethodsAsBeanMembers=true, sharedClassIntrospCache=#1896185155, ...))
The blamed expression:
==> sortedStatsMap[rowTag.name]! [in template "reports/templates/techReport-boxes.ftl" at line 152, column 84]
If I try
sortedStatsMap[rowTag.name]!?is_hash
then this also fails because if missing, it gives me empty_string_and_sequence and ?is_hash can't be applied, reportedly. (Says that in an error.)
What's the proper logic to check whether I can use ?api.get(key)? Or the right way to use ! to handle missing values or a missing key?
You can check if a value supports ?api with ?has_api. Though maybe you don't need that; the example and the problems related to it should be clarified (see my comments).

Remove single quotes/quotation marks in Prolog

I have an extern API sending info to my Prolog application and I found a problem creating my facts.
When the information received is extensive, Prolog automatically adds ' (single quotes) to that info.
Example: with the data received, the fact I create is:
object(ObjectID,ObjectName,'[(1,09:00,12:00),(2,10:00,12:00)]',anotherID)
The fact I would like to create is
object(ObjectID,ObjectName,[(1,09:00,12:00),(2,10:00,12:00)] ,anotherID)
without the ' before the list.
Does anyone know how to solve this problem? With a predicate that receives '[(1,09:00,12:00),(2,10:00,12:00)]' and returns [(1,09:00,12:00),(2,10:00,12:00)]?
What you see is an atom, and you want to convert it to a term I think.
If you use swi-prolog, you can use the builtin term_to_atom/2:
True if Atom describes a term that unifies with Term. When Atom is instantiated, Atom is parsed and the result unified with Term.
Example:
?- term_to_atom(X,'[(1,09:00,12:00),(2,10:00,12:00)]').
X = [ (1, 9:0, 12:0), (2, 10:0, 12:0)].
So at the right hand side, you enter the atom, at the left side the "equivalent" term. Mind however that for instance 00 is interpreted as a number and thus is equal to 0, this can be unintended behavior.
You can thus translate the predicate as:
translate(object(A,B,C,D),object(A,B,CT,D)) :-
term_to_atom(CT,C).
Since you do not fully specify how you get this data, it is unknown to me how you will convert it. But the above way will probably be of some help.

How to use SWRL rules on Protegé 4.3 using Pellet

I've just started doing work on ontologies with Protegé and I'm trying to understand how to use SWRL rules. I'm afraid I don't get the concept or how to correctly treat them, as I'm not able to produce any output. I'll explain a bit more a simple case I created to test this:
I've created three individuals, called A, B and C. Each one with a test property, that has a boolean range. On the property assertions tab of each one I've initialized their values, so they are test(A,true), test(B,true) and test(C,true). To test how rules work, I created a rule like this: test(A,true), test(B,true) -> test(C,false). The way I understand it is that, if A and B's test property is true, C's one would turn false. To do so, I start the reasoner (Pellet) but nothing happens. I mean, it says the reasoner is active and no "inconsistent ontology" messages appear, but C's test value doesn't change. I'm sure this must be a really simple confusion but I can't seem to find it anywhere nor check if the rule has been activated.
Thank you in advance.
The inference doesnt work like that, you cannot retract test(C, true) if you've asserted it. Your ontology probably includes both test(C, true) and test(C, false) which is completely legal unless you've specified otherwise; in which case then you'd see the inconsistency.

proper syntax for bpel bpel:doXslTransform

I am trying to do an XSL transform on an xml structure in a bpel assignment statement. There is a syntax problem, but I am having trouble finding official documentation. There are examples all over the internet but I have not found a clear explanation. Here is my best shot. What do the last two parameters do? Why is eclipse saying the first argument must be a literal, even though test3.xsl is a string?
<bpel:assign validate="yes" name="Assign">
<bpel:copy keepSrcElementName="no">
<bpel:from>
<![CDATA[bpel:doXslTransform("test3.xsl", $personalInfoServiceOutput.parameters), "middle", $positionSkillManagementInput]]>
</bpel:from>
<bpel:to variable="positionSkillManagementInput"></bpel:to>
</bpel:copy>
</bpel:assign>
The signature of doXSLTransform looks as follows:
object bpel:doXslTransform(string, node-set, (string, object)*)
The first parameter is the name of the XSLT script, the second parameter is an XPath identifying the source document (e.g. a variable, part, nodeset, node). The third and the fourth parameter is a key-value pair, the string is the key and the object is the value. Those pairs are mapped into the script's parameter context so that you can access these values by their name in the script. There can be any number of these pairs.
The best resource to look up such things is the WS-BPEL 2.0 specification, doXSLTransform is described in Sect. 8.4
When I use the following code :
<bpel:copy keepSrcElementName="no">
<bpel:from>
<![CDATA[bpel:doXslTransform("parseSample.xsl", $output.payload)]]>
</bpel:from>
<bpel:to variable="output"></bpel:to>
</bpel:copy>
I also get the error, that first argument must be literal string.
But, when I deploy my service (with error) to wso2 bps, it works fine.
You can try with this.
I faced the same issue. Agree with NGoyal. Shows error in BPEL but works when deployed.

Resources