问题标签 [word]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票
10 回答
615 浏览

c - 你会使用什么分类技术?

如果您有 65536 个随机英语单词,每个单词的长度为 1-32,您需要计算外观并根据字典或外观排名进行排序,您如何构建数据以及使用哪种排序技术来最快地处理它?

0 投票
2 回答
489 浏览

visual-c++ - MailMerge:没有固定宽度的字体?

我正在尝试将数据发送到特定的 MergeField。数据已正确发送。数据的每一行都有特定的字符。例如,该字段的数据可能是:

12345 第一\nABCDE.F 第二

(它无法获得换行符,所以我只是通过字符\n)

现在在打印的文档中,每个字符都有一个宽度,例如“1”小于“E”。因此,数据未在字段内对齐。我尝试了以下字体:Arial、Tahoma、Courier New。没有任何帮助。

有任何想法吗?提前致谢。

Ps 数据是通过 Visual C++ 5.0 构建的可执行文件发送的!!

0 投票
6 回答
21766 浏览

php - 在 PHP 中将单词转换为数字

我正在尝试将写为单词的数值转换为整数。例如,“iPhone 有 230783 个应用程序”将变为“iPhone 作为 230783 个应用程序”

在我开始编码之前,我想知道这个转换是否存在任何函数/代码。

0 投票
5 回答
6161 浏览

mysql - 计算表格列中的单词出现次数

我有一个带有 varchar(255) 字段的表。我想(通过查询、函数或 SP)从该表中获取一组行中每个单词的出现次数。

如果这些字段有 2 行:

我想得到

任何想法?我正在使用 MySQL 5.2。

0 投票
5 回答
19243 浏览

python - 如何用python找到最长的单词?

如何使用 python 从一组单词中找到最长的单词?我可以找到这样的第一个词:

0 投票
4 回答
1404 浏览

algorithm - 分词算法

什么算法 - 似乎在域名停放页面上使用 - 需要一堆无空格的单词(例如“thecarrotofcurioity”)并或多或少正确地将其分解为组成词(例如“好奇的胡萝卜”)?

0 投票
4 回答
20623 浏览

php - PHP - 从字符串中获取某个单词

如果我有这样的字符串:

我怎样才能让名字被呼应?除了名称之外,每个字符串看起来都像这样,并且可能有所不同。

0 投票
2 回答
1388 浏览

xslt - 复杂的 XSLT 拆分?

是否可以在从小写到大写边界拆分标签,例如,标签“UserLicenseCode”应该转换为“User License Code”,以便列标题看起来更好一些。

我过去使用 Perl 的正则表达式做过类似的事情,但 XSLT 对我来说是一个全新的球类游戏。

在创建这样一个模板的任何指针将不胜感激!

谢谢克里希纳

0 投票
10 回答
1179 浏览

word - Code Golf - Word Scrambler

Please answer with the shortest possible source code for a program that converts an arbitrary plaintext to its corresponding ciphertext, following the sample input and output I have given below. Bonus points* for the least CPU time or the least amount of memory used.

Example 1:

Plaintext: The quick brown fox jumps over the lazy dog. Supercalifragilisticexpialidocious!

Ciphertext: eTh kiquc nobrw xfo smjup rvoe eth yalz .odg !uioiapeislgriarpSueclfaiitcxildcos

Example 2:

Plaintext: 123 1234 12345 123456 1234567 12345678 123456789

Ciphertext: 312 4213 53124 642135 7531246 86421357 975312468

Rules:

  1. Punctuation is defined to be included with the word it is closest to.
  2. The center of a word is defined to be ceiling((strlen(word)+1)/2).
  3. Whitespace is ignored (or collapsed).
  4. Odd words move to the right first. Even words move to the left first.

You can think of it as reading every other character backwards (starting from the end of the word), followed by the remaining characters forwards. Corporation => XoXpXrXtXoX => niaorCoprto.

Thank you to those who pointed out the inconsistency in my description. This has lead many of you down the wrong path, which I apologize for. Rule #4 should clear things up.

*Bonus points will only be awarded if Jeff Atwood decides to do so. Since I haven't checked with him, the chances are slim. Sorry.

0 投票
5 回答
5395 浏览

python - 从 python 中的随机输入字母中查找单词。已经有什么算法可以使用/编码?

我正在尝试在这里编写一个像这样的单词解扰器,并且想知道我应该使用什么算法来实现它。此外,如果有人能找到现有的代码,那也很好。基本上,该功能将像一个 boggle 求解器,但不是矩阵,只是从字符串中搜索所有单词的可能性。我已经有足够的字典了。

我打算在 python 或 ruby​​ 中执行此操作。提前感谢您的帮助!