In excel all formulas are translated, e.g. I can write SUMME instead of SUM, or HEUTE instead of TODAY.
I can't find an option to change the language, except for the UI. Is it possible to change the language of the formulas?
Options -> LibreOffice Calc -> Formula -> Use English function names (under "Formula Options", just after "Formula syntax"; default: yes).
Related
In Julia, how can I check an English word is a meaningful word? Suppose I want to know whether "Hello" is meaningful or not. In Python, one can use the enchant or nltk packages(Examples: [1],[2]). Is it possible to do this in Julia as well?
What I need is a function like this:
is_english("Hello")
>>>true
is_english("Hlo")
>>>false
# Because it doesn't have meaning! We don't have such a word in English terminology!
is_english("explicit")
>>>true
is_english("eeplicit")
>>>false
Here is what I've tried so far:
I have a dataset that contains frequent 5char English words(link to google drive). So I decided to augment it to my question for better understanding. Although this dataset is not adequate (because it just contains frequent 5char meaningful words, not all the meaningful English words with any length), it's suitable to use it to show what I want:
using CSV
using DataFrames
df = CSV.read("frequent_5_char_words.csv" , DataFrame , skipto=2)
df = [lowercase(item) for item in df[:,"0"]]
function is_english(word::String)::Bool
return lowercase(word) in df
end
Then when I try these:
julia>is_english("Helo")
false
julia>is_english("Hello")
true
But I don't have an affluent dataset! So this isn't enough. So I'm curious if there are any packages like what I mentioned before, in Julia or not?
(not enough rep to post a comment!)
You can still use NLTK in Julia via PyCall. Or, as it seems you don't need an NLP tool but just a dictionary, you can use wiktionary to do some lookup or build the dataset.
There is a recently new package, Named LanguageDetect.jl. It does not return true/false, but a list of probabilities. You could define something like:
using LanguageDetect: detect
function is_english(text, threshold=0.8)
langs = detect(text)
for lang in langs
if lang.language == "en"
return lang.probability >= threshold
end
end
ret
I have to deal with translation in po/mo format.
Basically an example of my po:
msgid "content_book"
msgid_plural "content_books"
msgstr[0] "%s book"
msgstr[1] "%s books"
It seems that %s or %d placeholders are quite common.
But the Symfony component use the placeholder %count%
https://github.com/symfony/translation-contracts/blob/main/TranslatorTrait.php#L50
Is there any possibility to use Symnfony/Translation component with po/mo file without to convert them in the icu format (https://symfony.com/doc/4.4/translation/message_format.html)?
I have to use sf 4.4 for now (wait for the next lts in 5.x).
Thanks for the help.
Gettext is not meant to be used in the way you are attempting to use it. msgid (and msgid_plural) are supposed to contain the actual human-readable text in English (or whatever your base language is), not some symbol names.
PO files with only symbol names as msgids are also painful to translate, and involve much more manual work than proper PO files do.
While learning Isabelle (2020), I tried to copy an example from its documentation (PDF) into a .thy file, which contains an iterated implication. Since the documentation is in PDF, I don't know what the correct ASCII for it should be. The closest I can get is this:
lemma "[[ xs # ys = ys # xs ; length xs = length ys]] ==> xs = ys"
But Isabelle complains about an "Inner Syntax error". I tried to use "[...;...]", but Isabelle seems to be treating it as a list, and complains about clashing between list and bool.
How should one type the formula in ASCII?
In general, how does one find the ASCII for notation from the PDF documentation? Is there a look-up table somewhere?
The name of these symbols is \<lbrakk> and \<rbrakk>. The corresponding Unicode characters are ⟦ and ⟧. If you type [| or |] in Isabelle/jEdit, it will automatically get converted to these.
Copying code out of PDFs almost never works; PDF is a pretty horrible format.
One good place to find symbols is the ‘Symbols’ tab in Isabelle/jEdit. You can e.g. find these brackets in the ‘Punctuation’ section. There is also the ~~/etc/symbols file, but I don't think that is very helpful for this case because it only shows the Unicode codepoint, but not the character itself.
I'm trying to test some algorithms in LibreOffice Calc and I would like to have some global variables visible in all cell/sheets. I searched the Internet and all the posts I have seen are so cryptic and verbose!
What are some simple instructions of how can I do that?
Go to Sheet → Named Ranges and Expressions → Define. Set name to "MyVar1" and expression to 5. Or for strings, use quotes as in "foo". Then press Add.
Now enter =MyVar1 * 2 in a cell.
One strategy is to save the global variables you need on a sheet:
Select the cell you want to reference in a calculation and type a variable name into the 'Name Box' in the top left where it normally says the Cell Column Row.
Elsewhere in your project you can reference the variable name from the previous step:
Using user-defined functions should be the most flexible solution to define constants. In the following, I assume the current Calc spreadsheet file is named test1.ods. Replace it with the real file name in the following steps:
In Calc, open menu Tools → Macros → Organize Macros → LibreOffice Basic:
At the left, select the current document test1.ods, and click New...:
Click OK (Module1 is OK).
Now, the Basic IDE should appear:
Below End Sub, enter the following BASIC code:
Function Var1()
Var1 = "foo"
End Function
Function Var2()
Var2 = 42
End Function
The IDE should look as follows:
[![Enter image description here][5]][5]
Hit Ctrl + S to save.
This way, you've defined two global constants (to be precise: two custom functions that return a constant value). Now, we will use them in your spreadsheet. Switch to the LibreOffice Calc's main window with file test1.ods, select an empty cell, and enter the following formula:
=Var1()
LibreOffice will display the return value of your custom Var1() formula, a simple string. If your constant is a number, you can use it for calculations. Select another empty cell, and enter:
=Var2() * 2
LibreOffice will display the result 84.
I have written a plain text in notepad editor. This text contains some embedded mathematical formulas like \sumw_if(x_i) which refers to \sumw_if(x_i) or \alpha^2 + \beta^2 = \gamma^2 which refers to \alpha^2 + \beta^2 = \gamma^2etc.
Now, I'm looking for a way to autocorrect all those formulas within ms-word. First I tought to select formulas one by one and then "ALT +" to get the maths notation. This method works fine but it's frustrating because I have a bunch of equations
Is there any help? Macros, MathML or other tips?
Regards
If the embedded mathematical formulas were delimited with dollar signs -- e.g., $\alpha^2 + \beta^2 = \gamma^2$ -- MathType can do it with its Toggle TeX feature. If it's something you want to do programmatically, there's the MathType SDK.