Download the PHP package cytsunny/rand-chinese without Composer

On this page you can find all versions of the php package cytsunny/rand-chinese. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package rand-chinese

中文亂文隨機生成器

為什麼需要這個亂文生成器?

現在比較好的亂文生成器主要都是直接在網上生成,只可以人手複製到要用的地方。如果只是用來設計時試排版是沒問題的,但是有如果需要大量生成就不太方便。(例如做 unit test 的時候想要中文輸入)

另一個常見的做法就是在 UTF8 中指定漢字一段,再隨機在其中抽出文字。這樣生出來的字大概是這樣的:

悍箳寊貈绺鶭缂迩泜輅歍銋囄轴埄侭鐸攛塰俟兯锁沟忍鳚苚鉤

雖然生出來的是方塊字,但太陌生的字看起來還是不像是中文。(事實上也真的可能不是中文,因為那段叫 CJK - Chinese, Japanese, Korean,即中文正體字、簡體字、日本漢字和韓國用的漢字都包含在內。因為有些的確是一樣的,所以這不能怪 UTF8。)

這個生成器使用香港課程發展處中國語文教育組的《中英文對照香港學校中文學習基礎字詞》中記載的正體字,只收錄大概 4000 多個在香港中小學會接觸到的正體字。生出來的字大概是這樣的:

攻格瑣雇嬪腐楓蹉臭舖黏沖賒廬侮彭疼呃淅龐

好吧,雖然總算是一些讀得出來的字了,但看起來還是有點太複雜。所以我還增加了一個複雜程度的選項。我把 4000 多個字按筆劃多少排序,由少筆劃到多筆劃,然後從中抽取頭 500 個(這個數字可以選擇)。生出來的字大概是這樣:

朽乏斤允叉企十妃划巧毛任只舌吁冬低乙友弘

如何使用這個生成器?

你可以直接下載 randChinese.php,或使用composer:

然後:

未來可能會增加的功能

實際做出來的時間視乎有多少人想要,以及多少人使用這個生成器。

  1. 支援 composer

  2. 增加「加入標點符號」這個選項

  3. 選擇生成較顯淺的中文字(主要看筆劃決定難度)

  4. 生成中文名稱

  5. 製作 Javascript 版本

All versions of rand-chinese with dependencies

PHP Build Version
Package Version
No informations.
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package cytsunny/rand-chinese contains the following files

Loading the files please wait ....